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