November 19, 2009 at 7:53 am
Hello All,
I am new to SSIS and have a question for any who can help.
I have a file that is provided to me Quarterly that I need to import into my production database. My filename looks something like this "2009_Q3_MSI_Business_In_Footprint_sample09.txt", I need to parse out the Q3 in the name and ad it to a field in each record.
So I need to access the default directory, read the file that is in this directory and parse out the Q3 in the name into a variable that I can then use to populate my database.
Any ideas which tool would be best to handle this? How could I implement?
Thanks in advance for any assistance,
November 19, 2009 at 12:30 pm
Hi - one option could be something like this:
1) Declare a string variable (user::filename) within the scope.
2) Use a for each loop container to get the actual filename(as this is going to be variable always). Use collection tab and foreach file enumerator of the for each loop container to find the file and assign the filename to user::filename variable in variable mapping tab.
[ If you are unsure how to do this - refer here:
refer the section : The ForEach Container. ]
3) Now use a derived column transformation from the filesource where add/use a derived column to append the - Q3/Q4 - but doing some string operation on user::filename.
Let me know if this answers your query.
[font="Comic Sans MS"]--
Sabya[/font]
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply