Hi, I'm having some problems when I try to write the contents of an ArrayList to a CSV file. The file is generated and saved in my hard drive, but when I open it every row is stored in a single cell, instead of puting each value in a separate cell. My code is:
FileOutputStream fileOutput= new FileOutputStream("c:\\informe.csv");
PrintStream out = new PrintStream(fileOutput);
String separator = ","
response.setContentType("application/octet-stream");
response.setHeader( "Content-Disposition", "attachment; filename=\"" + fileOutput + "\";" );
out.print("Cell1" + separator);
out.print("Cell2" + separator);
out.print("Cell3 + separator);
out.close();
What am I doing wrong? Thanks a lot.