I have flat file source and connection manager. I need to configure its connection string as filename_* .txt. I have one variable on package level to read the directory path and then I am using it in expression property to read the file path as @FilePath "filename__* " ".txt". This is not working. I am not able to figure out how to configure file name as filename_*.txt.
CodePudding user response:
In a case like this best practice is to use a foreach loop container of type File Enumerator, you can pass it a search string to scan for files and run a process using the found file name.
Note if you have multiple files in that folder it will run the same process for each file
The container will then execute everything inside it for each file found with that search string. You will need to map the found file name to a variable on the Variable Mapping section.
You can now use the variable as an expression in your file connection
Your control flow should look like this