I have a folder having multiple files with the name as
P04_20140326_1234.zip
P04_20130324_58714.zip
P04_20130808_jurhet.zip
P04_20130815_85893.zip
etc
The name is in the format P04_systemdate_*.zip.
I want to pick the folder containing currentdate in the name and unzip it first and load the data from extracted file into the table.eg : file named as A.txt goes into table A, filenamed as B goes into table B and so on...
I guess you have already done the following:
Data Flow
flat file source
, and Ole_DB destination
flat file source
to point to one of your files and connect all the appropriate columns so that data flows from file to database.If all of this is already working, then let's do the For-Each loop
CsvFileName
of type stringForEach loop
(not a For loop)Foreach File Enumerator
FlatFileSource
, and choose propertiesDelayValidation
to "True"ConnectionString
property to use the "CsvFileName" variableRun it. This should load all files. Now, if you just want to restrict it to a date here's what you do:
"*" + @[User::FilterDate] + "*.csv"
Now it will only filter the files that you want.