OwenS
OwenS

Reputation: 233

SSIS Foreach Loop with specific flat files

I am trying to import different csv files from a folder containing different csv file types. So I need to filter my foreach loop with the starting flatfile name. I only want to process files starting with MyFileType_1*.csv and not the others in the same folder. Any suggestion is welcome, thanks.

Upvotes: 1

Views: 2973

Answers (2)

Daniel Dinnyes
Daniel Dinnyes

Reputation: 5017

Nighty_'s answer is correct, but just for the sake of completeness it is worth mentioning that to set the ConnectionString in a Flat File Connection you must use a variable of package-level scope in the expression (in his case @[User::v_FilePath]). This is because the connection itself is package level. This might feel a bit unintuitive... or ugly... it is.

Upvotes: 0

Nighty_
Nighty_

Reputation: 545

In your for-each container can specify which files to read as Ocaso is saying. In the Variable mappings tab in the for-each container you can there set which variable you want to save the files found. Then you can use this variable as the connection string to a flat file connection. Set which files to read Set variable mappings Set connection string

Upvotes: 2

Related Questions