Question

I am using SuperCSV for reading and writing csv files. The problem i am facing is, under Unix/Linux systems, I am getting "^M" character appending to end of each line, which is quite annoying.

How do I handle/fix that.

beanWriter = new CsvBeanWriter(new FileWriter(this.file), CsvPreference.STANDARD_PREFERENCE);
final CellProcessor[] processors = getProcessors();
beanWriter.write(writeBean, header, processors);

part of code how I am exactly using SuperCSV

Était-ce utile?

La solution

Like the docs and website say, use CsvPreference.EXCEL_PREFERENCE.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top