File Mover Blog

January 29, 2023

Download only certain date specific files

Q: Download only certain date specific files from FTP
I have an ftp account that has a file for each day of the month in it. I need to download a file each day for that particular Monday – Sunday. This will go into a rename job so for example file 01162023 (for Monday, January 16, 2023) would be renamed to SLMON. File 01172023 would rename to SLTUE, 01182023 SLWED, and so on until 01222023 for SLSUN.

So once more, I would need to set a download each night to pull a file with that dates name and have it rename. So tonight would download file 01212023 and rename it to SLSAT. Then Sunday would pull a single file for that date. Is that doable?

A: Yes this is possible, so you would trigger it every evening and it would pick up the file for tomorrow and rename it. This will also work for other source types than FTP.

1. Please open the File Filter Setup

– Enable ‘Allow parameters in File Name filter’ in the Advanced Tab:

Limagito File Mover File Filter setup

– Set the Filename Include Filter to:
%TCD:[IncDay+1]mmddyyyy:.pdf

In my example I’m looking for .pdf files but it could also be like (every type of file):
%TCD:[IncDay+1]mmddyyyy:.*

Notice the [IncDay+1] so it looks for the next day.
Limagito File Mover Date specific files

2. Open the Destination setup
Limagito File Mover WIN as Destination

– Rename Tab > Enable Rename Files > Setup Renaming:
Limagito File Mover Destination renaming options

– Add the following renaming expression:

RegEx:   (.*)\.(.*)
Replacement:   SL%TCD:[IncDay+1]ddd:.\2

Limagito File Mover Destination renaming setup

– Customer: Great thanks. What would I do if I pulled it at say 1am for the same day?
– Limagito: Remove the   [IncDay+1]   in the File Filter AND the Renaming setup

#FileTransfer #FTP #SFTP

If you need any info about this post, please let us know.

Best regards,

Limagito Team

By Limagito-Team Filters FTP Share:
SEARCH