December 11, 2013 at 3:00 pm
I have a foreach container that processes zero or more similarly-named csv files, then moves each file to an archive folder. I want to append (or prepend) the date to the filename upon moving it to the archive folder, but can't quite figure out how to do that with the "move" function of the File System Task. What's the strategy?
I have variables for the ImportFolder (path), the FullyQualifiedFileName of the csv file (UNC)....
Jim
December 12, 2013 at 8:35 am
I usually handle this with a script task. In C# it would be something like...
File.Move(Dts.Variables["User::FullyQualifiedFileName"].Value.ToString(), Dts.Variables["User::FullyQualifiedFileName"].Value.ToString().Replace(".csv", DateTime.Now.ToString() + ".csv");
December 12, 2013 at 9:07 am
December 14, 2013 at 3:46 pm
you need to use the expressions (left hand pane in the editor window) and create a formula that appends the date before the file extension. I don't have SSIS to hand at this present time, if you struggle post back and I will get you some sample code.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply