title: Writing a 2d array to a csv file
body: <p>I have a program that has a 2d array and I need to write to a csv file but I only need to write one one index of the array. I'm using the .get(0).set(4, newAmount) to set a value in the first index but I need to write all values of the index to a file if that makes sense.</p>
  
  <pre><code>         fw = new FileWriter(FILE_NAME, true);
           bw = new BufferedWriter(fw);
  
          System.out.println("Enter the name of the person you want to change amount for");
         String changeName = FileUtility.getInput().nextLine();
         String newAmount;
  
  
  
          Scanner s = new Scanner(new File(FILE_NAME));
          String str = "";
          List&lt;List&lt;String&gt;&gt; list = new ArrayList&lt;List&lt;String&gt;&gt;();
  
          while (s.hasNext()) {
          list.add(Arrays.asList(s.nextLine().split(",")));
   }
  
   if (list.get(0).get(0).equalsIgnoreCase(changeName)) {
    System.out.println("Enter the new amount paid for the player");
    newAmount = FileUtility.getInput().nextLine();
    list.get(0).set(4, newAmount);
    //write to csv file here
  </code></pre>