In Talend how to fetch latest file

Viewed 3366

I have three files which are having the same schema,

A1(file) received at 12:30:000.00,
A2(file) received at 12:35:000.00,
A3(file) received at 12:40:000.00.

Now I want to fetch the latest file which is A3.

Note: I have used to tfilelist component to fetch the file.

3 Answers

Talend Docs for tFileList:

Order by:

By modified date: most recent to least recent or least recent to most recent.

The Talend Knowledge Base has a load of information about components. Also, the components speak mostly for themselves if you examine them a bit.

tFileList --> tFileProperties --> tJavaRow

  • tFileList to iterate over the file list
  • tFileProperties to get files properties
  • tJavaRow to save the filepath (using a global variable) for the file with the greatest value for mtime field

After that, tFileInputDelimited using the global variable for filename

Related