Fetching latest files from multiple folders of FTP location through date in filename

Six Stars

Fetching latest files from multiple folders of FTP location through date in filename

On my ftp location, I have files with filenames like, "Alpha_01_01_2018_to_01_01_2018,csv"

There will be multiple files with those names across different folders here. I need to pick them every day. Today, I need to pick "Alpha_03_10_2018_to_Alpha_03_10_2018.csv" from all the folders there while tomorrow, I'd have to pick "Alpha_04_10_2018_to_04_10_2018.csv"
The date format here is dd_MM_yyyy in filemask.

I tried testing in filemask with 

"Alpha_"+TalendDate.formatDate("dd_MM_yyyy", TalendDate.getCurrentDate())+"*.csv"

but it won't work. I want it to work everyday when put in a windows scheduler, picking latest files from FTP location.

And there is no error from the job when it runs. Can anyone assist with this?

Highlighted
Forteen Stars

Re: Fetching latest files from multiple folders of FTP location through date in filename

Hi 

 

your filename pattern look correct, think the problem in:

There will be multiple files with those names across different folders here.

how You go thru the folder structure? how deep it?

-----------

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog