Home » excel » c++ – Add new line characters (\n) into CSV file?

c++ – Add new line characters (\n) into CSV file?

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have a CSV files whose data is taken from multiple other CSV files. I copied over the data from these files one column at a time and I want the file to be read one line at a time using the c++ method getLine().

Problem is that getLine returns the entire file as one line. I suspect the way I copied them and did not include a column with an end line character has lead to each row not having the character at the end.

Is there a way to add them in? I’m using Libre Office but I can also switch to excel.

How to&Answers:

Open it in Libre Office’s word processor. Save it as whatever file type Libre saves documents. That should add the proper line endings. Then save it back as plain text.