我有一个文件,我无法控制输出,每个数据行都有一个尾随逗号,而不是标题行.
"Pid","Dtdate","Tencode","Stype","Amount","Currentbal" "13773793","05/26/2014","Abc123","PAYMENT","50.00","1807.95","13773794","ADJUSTMENT","10.00","18.95","",
我试图找出如何修剪尾随逗号的每一行,以便它将正确读取SSIS.
"Pid","1807.95" "13773794","18.95" ""
我假设我会使用脚本转换,但这就是我遇到的问题,我没有太多编程所以我在VB脚本任务中相当新手.
可能值得一提的是,这是在FOR每个循环中获取文件夹中的所有文件.通常只有一个文件,但我正在为倍数的潜力腾出空间,文件名是文件名的变量表达式:@ [User :: FileName]
我的假设是,一旦动态生成文件,您就失去了指定列规则的能力.这就是为什么我正在寻找一种方法来修剪每行的尾随逗号.
我得到的错误是
[Flat File Source [18]] Error: The column delimiter for column "Currentbal" was not found. [Flat File Source [18]] Error: An error occurred while skipping data rows.