如何在多行上写数据但在同一个单元格的csv? [英] How to write data on multiple lines BUT within the same cell of csv?
问题描述
我想使用C#创建一个csv文件。
I want to create one csv file using C#.
我有一些数据,我想在同一单元格内的多行上写。
I have some data which I want to write on multiple lines BUT within the same cell.
例如
如果我有以下三句话:
For example If I have following three sentences,
Sample sentence 1. This is second sample sentence. and this is third sentence.
我想在csv文件的单元格中写这三个句子,但我想要三个单独行。
I want to write all these three sentences within single cell of csv file but I want three of them on separate line.
我的预期输出是:
Sample sentence 1.
This is second sample sentence.
and this is third sentence.
目前我正试图通过使用 \\\
两个句子之间的字符,但是当我这样做,所有三个句子都在单独的行。
Currently I am trying to achieve this by using \n
character between two sentences but when I do it this way, all three sentences go on separate row.
任何人都可以告诉我如何解决这个问题?
Can anyone please tell me how to solve this problem?
推荐答案
要报价维基百科:
具有嵌入换行符的字段必须
括在双引号
字符中。 / p>
Fields with embedded line breaks must be enclosed within double-quote characters.
例如:
1997,Ford,E350,"Go get one now
they are going fast"
这篇关于如何在多行上写数据但在同一个单元格的csv?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!