SSIS Exclude specific files in the Loop Contacher container

I have an SSIS package that downloads csv files from a specific directory using an expression and a wildcard to collect all the files.

Currently, the FileSpec container container is looking for all files with the following format:

fileName_environment _ *

and it works fine. The second set of files is now loaded from the same directory, and for their difference the file format:

fileName_environment_business _ *

So, the second SSIS package selects only new files, since the file structure will look like this:

 filename_environment_abc filename_environment_def filename_environment_xyz filename_environment_business_abc filename_environment_business_def filename_environment_business_xyz 

but the first package will process all the files.

So the question is, can I install FileSpec in the first SSIS package to ignore files that are in the format:

fileName_environment_business _ *

+2
source share
1 answer

In the foreach loop container, put a dummy Script task before you already have the first block. Connect these two to the line and set the Constraint Options expression to the expression in which you must define the FINDSTRING function:

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

Where @var is a loop.

Only files without a β€œbusiness” inside will go to the next step. Hope this is what you wanted.

+5
source

Source: https://habr.com/ru/post/1266483/


All Articles