Specifying multiple file types in SSIS Foreach loop Container e.g: .txt and .dat
It doesn't work. :(ZK
August 4th, 2012 2:47am

If you want multiple file types in one Foreach Loop you could use regular expressions ^.*\.(txt|dat)$. Here is a Script Task Example: http://microsoft-ssis.blogspot.com/2012/04/regex-filter-for-foreach-loop.html Or you could use a custom enumerator: http://microsoft-ssis.blogspot.com/2012/04/custom-ssis-component-foreach-file.html Or just use two Foreach Loop Containers :-) Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
Free Windows Admin Tool Kit Click here and download it now
August 4th, 2012 2:52am

Thanks SSISJoost. You are getting closer to the solution but the problem with your implementation is that it will going to work on my machine as i installed the thrid party app. But the enviroment where it will going to deploy wont have that app. ZK There is a Script Task solution for those who can't or don't want to install third party tools.Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
August 4th, 2012 3:33am

Select name and extension option and put *.*
Free Windows Admin Tool Kit Click here and download it now
August 4th, 2012 4:07am

Kingxxx1 , it wont work. I need .txt and .dat file extension not others to be moved.ZK
August 4th, 2012 11:09am

Thanks SSISJoost. You are getting closer to the solution but the problem with your implementation is that it will going to work on my machine as i installed the thrid party app. But the enviroment where it will going to deploy wont have that app.ZK
Free Windows Admin Tool Kit Click here and download it now
August 4th, 2012 11:09am

I want to Specify multiple file types in SSIS Foreach loop container FILE property under COLLECTION tab. Here is the scenario: Rename the specific files with the specific extension with timestamp (there are other files with the same extension is present as well in the folder). 1) customer.txt 2) employee.dat Move these files after renaming it with timestamp archive folder. I dont know how to give to specific file extension in FILE scetion under COLLECTION tab in for eachloop container. Thanks in advance! ZK
August 5th, 2012 1:00am

Hi, create a variable in SSIS package : right click anywhere in your package and click on variables --> create a variable as "FileName" with string as datatype Drag the For each loop container in to control flow.. Set enumarator as : For each file.. Set Directory. Go to Varaible Mapping add ::"FileName" and put index 0. Now Drag a script task in side the for each loop container.. Select FileName as Read only or read write.. Write a logic to check the format and do what ever you want...
Free Windows Admin Tool Kit Click here and download it now
August 5th, 2012 1:11am

I know how to move all files or file with single file extension to another folder using variable. Problem here it is that we have to move two specific files with the different file extension (keeping in mind we have other files presented with same file extension in a folder). ZK
August 5th, 2012 1:17am

Go to Expresions Tab.. Set Deirectory.. By default.. Give any one of the file name with any extension..
Free Windows Admin Tool Kit Click here and download it now
August 5th, 2012 1:40am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics