Topic "Script for Renaming the file in local Folder"

Author Message
[View user's profile]

Joined: 2014-02-14
Posts: 1
Location: Gurgaon
Dear All,
I have the daily file with name like Sales 12-02-2014, Sales 13-02-2014,
Sales 14-02-2014,Sales 01-03-2014. I want to auto upload from ftp to local machine with file name as maximum of date per month. That is Sales-Feb-2014 and Sales-Mar-2014 and old file in local folder to replace with new files.. Please help ASAP.

I have given the script as

option batch continue
option confirm off
Open "Session"
Lcd "Local Folder(ie E:\")
get "Remote Folder(/Home/folder/*Sales*.CSV>1d" )

It is coping only last updated date but not replacing old one per month. If old files is 31-Jan-2014, new one is 01-Feb-2014. Than 31-Jan-2014 could not delete. If Old file is 01-Feb-2014, new file is 02-Feb-2014. now 02-Feb-2014 to be replace with 01-Feb-2014 and not with 31-Jan-2014.

Thanks in advance,

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License