Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have a Talend job which will do the following:
What is the best way to move the most recent 4 files from my FTP server to Talend Server for processing? Also:
My main issues are how to grab only the last 4 files based on recency and then processing the files by date using a mask on their names as they also have a date. I think I would need to have a logic that is able to store the filenames date and compare it to a global variable whose date gets updated daily and is saved as a context variable and then compare and run the job if they match. Any help would be super appreciated as I am very new to this amazing tool.
Thank you all.
Hello,
For the current date, you can use function TalendDate.getCurrentDate() that you will store in a global variable.
By using components tFTPFileList with a link type "Iterate", you can access all files name by using the global variable CURRENT_FILE (created automatically by the compoent tFTPFileList).
Then you can filter using a tFilter one this filename by comparing the global var that contain current date and the date in the name of the file.
Of course you have to transform each date (current date and file date) to the good format to be sure that the comparision will be ok.
You will have something like :
tFTPFileList -> (iterate) tFixedFlowInput with one column = CURRENT_FILE globalVar -> tFilter -> your list of 4 files.