title: Java append new column to csv file
body: <p>I want to calculate some column data and write it to <code>csv</code> file as column. Then after calculating other column of data I want to append it to same file but as new column.</p>
  
  <p>Here is what I did:</p>
  
  <pre><code>try {
      FileWriter writer = new FileWriter(OUT_FILE_PATH, true);
      for (int i=0; i&lt;data.size(); i++) {
          writer.append(String.valueOf(data.get(i)));
          writer.append(",");
          writer.append("\n");
      }
      writer.flush();
      writer.close();
  } catch (Exception e) {} 
  </code></pre>
  
  <p>Result - It appends the new column below the first column, so I have single long column.</p>
  
  <p>Thanks,</p>