在csv字段中插入多行文字 [英] Inserting multiline text in a csv field
本文介绍了在csv字段中插入多行文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在CSV字段中插入多行文本数据.
I want to insert a multiline text data in a CSV field.
例如:
var data = "\nanything\nin\nthis\nfield";
var fields = "\"Datafield1\",\"Datafield2:"+data+"\"\n";
当我将fields
保存到 csv 文件并使用MS Excel打开它时,我只能看到第一列.但是,当我使用文本编辑器打开文件时,会看到:
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:
任何
在
这个
字段"
"Datafield1","Datafield2:
anything
in
this
field"
我不知道我是否违反 CSV 标准.即使我反对,也请提供解决方法.
I don't know whether I am going against CSV standards. Even if I am going against Please help me with a workaround.
谢谢...
推荐答案
默认情况下,MS Excel使用分号作为分隔符.使用;
,您会看到以下内容:
By default MS Excel uses semicolon as a separator. use ;
and you'll see this:
这篇关于在csv字段中插入多行文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文