title: CSV file can not update
body: <p>I'm trying to make a program that gives marks for student.</p>
  
  <p>First it should ask the student id, after that you need to give mark each of the criteria to the same student.</p>
  
  <p>This code doesn't change anything after i gave the marks.</p>
  
  <pre class="lang-java prettyprint-override"><code>BufferedReader br = new BufferedReader(new FileReader("project.csv"));
  while ((line = br.readLine()) != null) {
      String[] cols = line.split(",");
      System.out.println("Please choose a criteria (2-7) ?");
      int subjectToGiveMark = in .nextInt(); // for creativity is 2
      System.out.println("Please enter a mark :");
      int mark = in .nextInt(); // which mark should be given 
      final int size = cols.length;
      String[] finalResult = new String[size];
      int index = 0;
  
      while (index &lt; finalResult.length) {
          if (index == subjectToGiveMark) {
              finalResult[index] = mark + "";
          } else {
              finalResult[index] = cols[index];
          }
          index++;
      }
  }
  </code></pre>
  
  <p>Can anyone tell me what is wrong with it ?
  <a href="https://i.stack.imgur.com/uP3n6.png" rel="nofollow noreferrer">enter image description here</a></p>