Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSV End of line

Hi i am trying to put end of line code in CSV format to import it to excel I tried putting
\n, "\n", \r, "\r", \r\n, "\r\n" but nothing worked for me I am trying to import it in excel 2013 my csv format is like below

Medicine;1213;22;19\nMedicine (miscellaneous);1013;32;55\nEngineering;708;14;21

please help. Field delimiter working fine but how to manage line break I want out put like this

Medicine                   | 1213 | 22 | 19   
Medicine (miscellaneous)   | 1013 | 32 | 55   
Engineering                | 708  | 14 |21

Thank you for your any help and suggestions

like image 456
sanu Avatar asked Mar 08 '17 08:03

sanu


People also ask

What is the end of line character in CSV?

The files are easily editable using common spreadsheet applications like Microsoft Excel. Fields are separated by commas. Records are separated with system end of line characters, CRLF (ASCII 13 Dec or 0D Hex and ASCII 10 Dec or 0A Hex respectively) for Windows, LF for Unix, and CR for Mac.

Should CSV have comma at end of line?

The rules for data which it understands are as follows: Each row must have the same number of comma-separated fields. Whitespace (space or tab) adjacent to a comma is ignored. Adjacent commas, or a comma at the start or end of a line (whitespace apart) indicates a null field.

How do I break a line in CSV?

New Line Characters Windows standard CR+LF or Unix-like systems (Linux, Mac) standard LF may be used as new line character.


1 Answers

In Notepad++ you can just do the following find and replace:

Find:

\\n

Replace:

\n

Be certain to do this in regex mode, not regular mode.

like image 151
Tim Biegeleisen Avatar answered Oct 13 '22 22:10

Tim Biegeleisen