Posted: 04 Nov 2010 18:31 | ||
Registered User Currently Offline |
Posts: 15 Join Date: Oct 2009 |
|
I want to download a file (say, DownloadOne.txt) and then rename it with datestamp YYYYMMDD (not time)
e.g. 20101104_DownloadOne.txt then I want to move only that file to another folder e.g. from C:\Temp to C:\Temp\Archive Looked at scripting manual but cannot get it to work. Thanks. |
Posted: 08 Nov 2010 23:39 | ||
Registered User Currently Offline |
Posts: 15 Join Date: Oct 2009 |
|
Here is how you can prepend the datestamp to the file:
setvar ~myfile, "DownloadOne.txt"; formattimestamp ~mytimestamp, "%YYYY%%MM%%DD%"; strprint ~mytimestampedfile, ~mytimestamp, "_", ~myfile; Instead of downloading, renaming, and moving, you can simply download this to to the final destination folder using the timestamped name like this: ftpsetpath local, "C:\\Temp\\Archive"; ftpdownload file, ~myfile, ~mytimestampedfile; |