I have a problem when generating my file CSV
from JAVA in the OS SunOS 5.10 (in Windows it works correctly) the format I need is MS-DOS
try what the following question from the SO English tells me:
But it does not work for me, also try with the following code taken from the forum in English:
public final static char CR = (char) 0x0D;
public final static char LF = (char) 0x0A;
public final static String CRLF = "" + CR + LF; // "" forces conversion to string
String twoLines = "Line1" + CRLF + "Line2"; // 12 characters
Source:
The same try with:
System.getProperty("line.separator")
But by no means did it come to me. I share my code that generates the CSV
:
archivoCsv = new CsvWriter(new FileWriter(new File(System.getProperty("user.dir")+"/../salida/"+campaniasBL.nombreArchivoExtraccion),false), ',');
archivoCsv.write("Folio de Campaña");
archivoCsv.write("Nombre de Campaña");
archivoCsv.write("Inicio");
archivoCsv.write("Fin");
archivoCsv.endRecord();
if (archivoCsv != null) {
archivoCsv.close();
}
I hope you can help me.