Topic "FTP Data Pull_Add 1 to file name on a nightly basis"

Author Message


My remote directory currently has a number of zip files within it of which house 3 files. The zip files are numbered in order(ie,,,etc.). Each evening a new zip is added increasing the file names number structure by 1. Within the zip file I have one single file that I need to get. The file within the zip folder has an extension of which increases in value by 1 each evening as well(ie filename.100, filename.101, filename.102, etc.).

I am wondering if there is a process at which I can:

1. get the most recent numbered zip file. I essentially want my script to increase the GET filename by 1 every time it runs. I do not want to utilize the 'last date modified' process of getting this due to the fact that there could potentially be other zip files out there with a timestamp similar to the zip files I need.
2. Unzip the file before transferring and access the file I need within
3. recognize the file within the zip based off of the +1 increase of the file extension on a daily basis. (ie filename.100, filename.101, filename.102, etc.).

To summarize, my end goal here is to access the root directory and unzip the most recent numbered zip file, unzip this file, access the most recently numbered file extension within and transfer this to my local directory.

Any help would be greatly appreciated.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27059
Location: Prague, Czechia
That's too specialized logic than you can expect from WinSCP to do for you.

You have to code this yourself. You can use PowerShell and call WinSCP .NET assembly from it.
Martin Prikryl

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