0

I am exporting data from sql table to CSV file. Few of my columns in the table has "Comma(,)" separated data, while loading the same into CSV file, data has been splitted into two columns.

Example

data in Sql table

ename    desig    Industry
Roy      PM       Business,Analyst  
Rem      PL       Marketting and Production  
King     PM       Marketting, Analyst  

while exporting the same data to CSv File it is coming in this way

 ename    desig    Industry
    Roy      PM       Business                       Analyst  
    Rem      PL       Marketting and Production  
    King     PM       Marketting                     Analyst  

Since this is CSV format, it is delimiting after comma and taking Analyst as another column instead of same with Industry column.

My required output in CSV File

ename    desig    Industry
    Roy      PM       Business,Analyst  
    Rem      PL       Marketting and Production  
    King     PM       Marketting, Analyst 

my FaltFileConnectionManager Settings are below

in General tab

Header Row Delimiter    {CR}-{LF}  

Columns Tab

Row Delimiter   {CR}-{LF}
Column Delimiter  Comma{,} 

I changed these setting , but still facing the same issue.

4

1 回答 1

0

编辑

由于从新信息中显示您没有使用 CSV(逗号分隔值)文件,而是使用管道分隔文件,因此问题似乎是超出此文件的任何处理都同时使用 | 和 , 作为分隔符,因此在有内部逗号的最后一个字段的中间进行分隔。由于您不想在字段中使用嵌入逗号的行业标准并在该字段上使用文本限定符,因此如果没有更多定义您用于测试文件的内容,我不确定我能提出什么建议,完成后处理文件的内容等。

用更多信息更新您的问题,我将完善我的答案。没有新信息的第一个猜测是,由于您在文件上使用 .CSV 名称,因此逗号处理是由下游处理的任何内容自动处理的。

/编辑

将文本限定符更改为 "(双引号),这应该使用 "" 限定文本字段,以遵循引用字符串的 CSV 文件的标准做法,以便嵌入的逗号不会导致字段中断。

于 2012-09-09T18:40:19.527 回答