September 8, 2010 at 2:37 pm
How to rename multiple excel files from a source folder to a destination folder with timestamps attached to it ?
I have used a file system task inside a foreach container to move the files using variables. It works but I am not able to rename the files.
September 8, 2010 at 2:40 pm
Not sure what you mean when you say you cannot rename the file.
When you copy the file, the file name in the destination should be the new name that you want. Is that what you're trying to do?
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
September 8, 2010 at 3:04 pm
Thanks . I first copied the files to the destination folder with timestamp attached to them using a file system task and then deleted the files with another FTP task.
Thanks for your help.
September 9, 2010 at 5:01 am
Take the File Name in an variable and add the following in the Script Task.
Dim vFileName, vDate, vFilePath As String
vFileName = CStr(Dts.Variables("v_FileName").Value)
vDate = Now.Date.ToString("yyyy/MM/dd")
vFilePath = vFileName & "_" & vDate & ".xls"
Dts.Variables("v_TextFileName").Value = vFilePath
Then Use File System Task to rename file with Source as v_FileName and destination varialbe as v_TextFileName.
Then Move the v_TextFileName to the desired destination folder.
Hope this may Help!
September 13, 2010 at 11:55 am
Please, check the following links.
Thanks
http://www.rafael-salas.com/2007/03/ssis-file-system-task-move-and-rename.html
September 14, 2010 at 4:20 pm
Hi
I had to do similar things recently and have documented the process... Please find attached are some docs that may be off help to you...
Cheers
vani
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply