August 12, 2011 at 10:10 am
I have 2 files named charge_t, the only difference is that one has a .txt extension and the other has no extension. I want to use a for each loop but want to exclude the file with the .txt extension. How can I do this?
August 12, 2011 at 10:29 am
I have done this using a script component as well as a stored proc that utilizes xp_cmdshell. Both can easily be used in SSIS to populate your object prior to use by the foreach loop.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
August 12, 2011 at 12:26 pm
I found a workaround, I first moved all of the files with the .txt extension using the regex "FileName*.txt" then used the foreach loop container to grab the ones I needed.
August 12, 2011 at 1:56 pm
You indicate no extension by ending your Regex with a period, e.g., "Filename*." The trailing period is optional if there is no extension, so it is usually omitted, but you want to include it in this case.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 12, 2011 at 2:00 pm
Ok, thanks. Good to know for future reference.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply