Inserting multiline text in a csv field

Tabrez Ahmed picture Tabrez Ahmed · May 11, 2012 · Viewed 23.6k times · Source

I want to insert a multiline text data in a CSV field.

Ex:

var data = "\nanything\nin\nthis\nfield";
var fields = "\"Datafield1\",\"Datafield2:"+data+"\"\n";

When I save fields into a csv file and open it using MS Excel, I get to see only the first column. But when I open the file using a text editor I see:

"Datafield1","Datafield2:
anything
in
this
field"

I don't know whether I am going against CSV standards. Even if I am going against Please help me with a workaround.

Thanks...

Answer

Grzegorz Grzybek picture Grzegorz Grzybek · May 11, 2012

By default MS Excel uses semicolon as a separator. use ; and you'll see this:

enter image description here