Append number to file names
I have a script that runs once per day to download files from a remote server. Because of the way they name the files, the names are sometimes too long. So currently I have it renaming the files and appending the date to the end (today variable is set in batch script independent of WinSCP functionality), but if there are multiple files I'm not sure how to handle it. There will be between 1 and 5 files at a time, so I was wondering if there is a way I can just add a number to the filename such as 1, 2, 3, etc.
It's currently in a batch script, and the WinSCP command is listed below. I am also open to other solutions if anyone has an idea. Thanks in advance.
It's currently in a batch script, and the WinSCP command is listed below. I am also open to other solutions if anyone has an idea. Thanks in advance.
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^ /command ^ "open sftp://redacted/ -hostkey=""redacted=""" ^ "cd /Home/bhpa19658/from_bh" ^ "get * -transfer=ascii -filemask=EVT_*.csv>1D R:\Files\EVT_%today%.csv" ^ "exit" >> R:\Logs\EventsLog_%today%.txt