Posted Wed, 13 Jan 2021 03:18:12 GMT by

I need to download the latest version of a file from an FTP site.

The filename is the following format "186_ExportData_ComplianceCheckFL_mmddyyyy.txt".

The FTP folder has many files with the same filename, for various dates mmddyyyy. The latest file would not have todays date at the point in time when the file is available for downloading.

In AutoMate 11 how can I determine the filename of the latest file for this specfic filename?


Thank you,

Posted Wed, 13 Jan 2021 03:37:23 GMT by

Hello Alan,


The following code will call the filename + todays date. You can use "%varFilename + varDate%.txt" to download todays file. 


%varFilename + varDate%.txt


Posted Wed, 13 Jan 2021 06:46:21 GMT by

Hello Ricardo,

Thanks for the reply. The latest file will not have today's date. The download will occur a few day after the latest/newest file is available for downloading. That is way I am trying to loop thru the FTP folder file list to determine the latest file in the folder.

Posted Thu, 14 Jan 2021 03:43:01 GMT by



Please take a look at our Bot Store -

I believe the Bot (Task) that you are looking for is FTP - Download newest or oldest file on FTP Server

Thanks, Chris

Posted Mon, 22 Nov 2021 17:40:03 GMT by Nathan Lasher BNY Mellon
Was a solution for this ever offered? I'm trying to download files from an SFTP site based on the modified date(s) of the files. For example the site may have 30 days worth of files, but I only need to download the ones that contain a modified date within the past 3 days. Is there a solution for this? Thanks, 
Automate version

You must be signed in to post in this forum.