SSIS - 如何仅使用 1 个文本限定符导入 csv
我正在使用SSIS并尝试导入CSV文件。但是,只有1个字段具有文本限定词 - 双引号“ - 又包含逗号。即使我指定了“作为限定符,SSIS似乎也忽略了这一点,并且仍然将数据分配到下一个字段中 - 是否有一个解决方案还是所有列都需要预选赛才能工作?
这是数据的一个示例:
Field1, Field2, Field3, Field4
ABC, 123, "QWER,ASD", ZXC
因此,当我目前导入时,SSIS正在分裂field3,即使我指定了“作为文本预选赛 - 为什么?
I'm using SSIS and trying to import a csv file. However, only 1 field has a text qualifier - double quotes " - which in turn also contains commas. Even if I specify the " as a qualifier, SSIS seems to ignore this and still splits the data into the next field - is there a solution or do all columns need the qualifier for it to work?
This is an example of the data:
Field1, Field2, Field3, Field4
ABC, 123, "QWER,ASD", ZXC
So when I import at the moment, SSIS is splitting Field3, even though I have specified " as a text qualifier - why is this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是您的文件,已畸形。您在值之前具有前导空间(
123
),并且行中的列不匹配;标题有5列和数据行4列。为了使一个值正确的文本合格,资格符必须位于值的开始:“ qwer,asd”
正确“ qwer,asd”
不正确您首先修复文件。大概您不想要领先的空间,所以看起来像这样:
然后SSIS按照您的期望工作:


如果您 do 想要领先的空格(在值和列名中),则应该像这样:
它也可以按照您的“期望”:

The problem is your file, it's malformed. You have leading spaces prior to your values (
123
) and a mismatch of columns in your rows; the header has 5 columns and the data row 4 columns. For a value to be correctly text qualified the qualifier must be at the start of the value:" QWER,ASD"
Correct"QWER,ASD"
IncorrectYou need to fix your file first. Presumably you don't want the leading spaces, so it should look like this:
Then SSIS works as you expect it to:


If you do want the leading spaces (in the values and column names) it should look like this:
Which also works as you would "expect":
