本文介绍了SSIS平面文件-CSV格式不适用于多行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要导入* .csv文件.头行带有列名,下面是数据行.问题出在description列中.该列具有多行文本,每一行都被视为记录.

I want to import *.csv file. There is head row with the column names, and data rows below. The problem is in column description.This column has multi-line text and each line is recognised as the record.

在多行文本中,文档的行尾有{CR}{LF},行尾有{LF}.像这样:

Document has {CR}{LF} for the end of row, and {LF} for the end of line in multi-line text. Like this:

(0)"Name","Description" {CR}{LF}
(1)"John","adsaddsadas" {CR}{LF}
(2)"Mike","dasdsadsdsda
dsadadsdasdsa {LF}
dsadadsadsad {LF}
dasdsadsadsd"{CR}{LF}
(3)"Dave","dsada"{CR}{LF}

返回错误,指出第(2)行被截断并且缺少数据

It returns an error saying the row (2) is truncated and is missing data

我选择了{CR}{LF}作为分隔符,但它仍将其识别为6条记录而不是3条记录,我想出于某种原因,它会将{LF}识别为行分隔符.

I have selected {CR}{LF} as delimiter, but it still recognises this as 6 records instead of 3, i suppose it, for some reason, recognises {LF} as row delimiter.

这里有人有类似的问题,或者知道如何解决这个问题.

Is there anyone who had similar issue here, or knows how to get over this.

我还要说我对此没有很多经验,所以我不知道是否有数据丢失.

Also i want to mention i don't have a lot of experience with this, so i don't know if there is data missing.

推荐答案

在平面文件连接管理器中,确保将Header Row Delimiter设置为{CR}{LF}

In your flat file connection manager make sure that the Header Row Delimiter is set to {CR}{LF}

并且Row Delimiter也设置为{CR}{LF}

并检查Description列的长度为4000 (以防止文本被截断),并且最后一列定界符为{CR}{LF}

And Check that Description Column has a length of 4000 (to prevent text from getting truncated) and that the last column delimiter is {CR}{LF}

这篇关于SSIS平面文件-CSV格式不适用于多行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 23:40