SSIS 2008 R2 issue rename files
Hi, I am using SSIS 2008 R2 and trying to rename multiple files in a folder. I am using a variable called @varRenameFile
Expression for this variable:
@[User::SourcePath] + (DT_WSTR, 2) MONTH( GETDATE() ) + "." +
(DT_WSTR, 2) DAY( GETDATE() ) + "." +
(DT_WSTR, 4) YEAR( GETDATE() ) + "_" + @[User::FileName]
But I want to rename it from for instance Test.txt to Test_06.13.2013.txt. When I use the above expression I am able to rename it to 06.13.2013_Test.txt but getting error doing it the other way round.
Thanks in advance.................
June 13th, 2013 11:21am
What do you mean the other way around?
Looks like you only need to capture the portion of the file name preceding the dot and then use in the expression. Best done in a Foreach Loop where you can capture the names of files.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2013 11:30am
Hi Arthur, Thanks for your response. Yes I need to capture the file name preceding '.' but I am not able to get it right could you please help. Need to rename file "Test.txt" to "Test_06.13.2013.txt".
Thanks
June 13th, 2013 11:45am
Thanks, figured it out.
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2013 1:24pm