CSV End of line
Asked Answered
A

4

5

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

Aquiline answered 8/3, 2017 at 8:28 Comment(6)
Does your original input file actually have any kind of line separator? Or, is it just all on a single line? Also, which text editor are you using to modify your CSV file?Hindsight
yes it just all on a single line that why it is not working any idea on it ?Aquiline
Are you certain there are no line separators there? Just because it renders on a single line does not mean there are no separators. If nothing really is there, then you might have to add them to get the Excel import to work.Hindsight
yes there is \n for line separators but that is not workingAquiline
Do you have access to Notepad++?Hindsight
yes I have Notepad++Aquiline
H
6

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.

Hindsight answered 8/3, 2017 at 8:43 Comment(0)
C
2

CSV uses RFC 4180. So the comment https://mcmap.net/q/1981912/-csv-end-of-line is incorrect. Most use cases are going that the EOL of csv is CR/LF.

In Unix(Ubuntu in my case), you can look it, when you open your file in cat -A /<someYourFilePath>

Ciao answered 15/11, 2019 at 15:2 Comment(0)
W
0

if the above is your text file. I have found that just pressing enter works in the text file.

example:

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

This is what worked for me.

Whelm answered 8/3, 2017 at 8:40 Comment(0)
P
0

The \n is just text to Excel. I used Word to Replace \n with Special Character Paragraph Code then saved as a txt file and that imported into Excel.

Pseudoscope answered 8/3, 2017 at 9:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.