6

我有一个 SSIS 包,它从特定目录加载 csv 文件,使用表达式和通配符来获取所有文件。

目前,FileSpec容器的 寻找具有以下格式的所有文件:

文件名_环境_*

这工作正常。现在正在从同一目录加载第二组文件,为了区分这些文件,文件格式为:

文件名_environment_business_*

因此,第二个 SSIS 包只选择新文件,因为文件的结构如下所示:

filename_environment_abc 
filename_environment_def
filename_environment_xyz 
filename_environment_business_abc
filename_environment_business_def 
filename_environment_business_xyz

但第一个包将处理所有文件。

所以,问题是,我可以将FileSpec第一个 SSIS 包的 设置为忽略以下格式的文件:

文件名_environment_business_*

4

1 回答 1

12

In the foreach loop container put a dummy Script task before the first block you've got already. Connect those two with a line and set Constraint Options to expression, in which you should define a FINDSTRING function:

FINDSTRING(@var, "business", 1) == 0

Where @var is the loop iterable.

Only files without "business" inside will proceed to the next step. Hope this is what you wanted.

于 2013-09-30T11:48:41.040 回答