Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSIS Loop through folders with specific names

Status
Not open for further replies.

shaferda

Programmer
Feb 14, 2012
5
US
I am attempting to loop through files in folders with the root of the name as tndlogs for example tndlogs, tndlogs0,
tndlogs1. The problem that I run into is that the SSIS expression language does not support wild card characters so
simply
using tndlogs* looks for a specific folder named tndlogs*. My thought is to read
all directory names that meet this criteria into a recordset and loop through them but how would I go about getting this list?
 
What i would do is this:

Loop through all folders. Then on each iteration run a small bit of VB script that checks to see if the folder name meets your spec.

If it does - set a variable to true, if not set it to false.

The continue within the iteration of folders but only do stuff where the variable is true (using a flow constraint).

Hope this helps

Dan

----------------------------------------

Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Bernard Baruch

Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
 
Thanks for all the help, I wrote a simple c# script task to pull the shared directories from the computer in question then looped through each directory and added to a collection object if it contained the criteria in its name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top