Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you encode CR/LF in into CSV files?

Tags:

csv

Is it possible/legal to somehow encode CR/LF characters into a CSV file?

(as part of a CSV standard?)

If so how should i encode CR/LF?

like image 417
Tore Nestenius Avatar asked Feb 19 '09 16:02

Tore Nestenius


1 Answers

Yes, you need to wrap in quotes:

"some value over two lines",some other value 

From this document, which is the generally-accepted CSV standard:

Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes

like image 82
Kent Boogaart Avatar answered Oct 13 '22 06:10

Kent Boogaart