1

我有以下格式的 CSV 文件

"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext ","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"300","331"
"Sometext","Sometext"," Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext ","Sometext",
"700","701

在上面的数据中,我想在使用 读取文件后的第 4 行和最后一行的数值之后添加额外的逗号Flat File Source,在这种情况下,应该在第 4 行和最后一行添加 6 个额外的逗号,以便正确的数据会是这样的

"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext ","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"300","331",,,,,,
"Sometext" "Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","一些文本",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext ","Sometext",
"700","701,,,,,,

我只需要在数据集中添加逗号而不修改现有文件如何在 SSIS 中实现?

4

1 回答 1

0

一种方法是使用脚本组件集作为数据流任务中的源。在下面的文章中找到一个详细的例子,它应该包括什么:

http://beyondrelational.com/modules/2/blogs/106/posts/11128/ssis-script-component-add-missing-column-or-ignore-extra-columns.aspx

这将添加缺少的列,并根据您的第一个标题行忽略任何额外的列。

于 2013-05-24T10:15:44.747 回答