Getting 2 recent files from FTP & difference on output

Seven Stars

Getting 2 recent files from FTP & difference on output

Hello everyone,


I'm having some troubles finding a solution to my problem. Here it is : 


I have access to an FTP server where i want to get the 2 newer files (XML), compares them & only get the difference as an CSV output.
Some more details :

My files on my FTP always looks: TEXT_yyyyMMdd_hhmm   , like that :


So here i would like to only extract the   TEXT_20180408_0950.xml   &    TEXT_20180409_0950.xml. If the files looks like that :


TEXT_20180408_0950.xml                                                             TEXT_20180409_0950.xml


<store>001</store>                                                                                      <store>001</store>
<ID>1</ID>                                                                                                   <ID>1</ID>
<qty>20<qty>                                                                                                  <qty>18<qty>
<price>3</price>                                                                                           <price>3</price>
<country>1</country>                                                                                   <country>1</country>

I want my output to be just : 


But if the lines are exactly the same, I want nothing in my output, and if in the 08/04 files there is a line which is not anymore in the 09/04 files,I want the line with 0 as quantity.

I'm currently blocked at only get the 2 newer files, i used a tFileList with a tFileInputXML with : " (String)globalMap.get("tFileList_1_CURRENT_FILEPATH") " as FILENAME but I dont see how get the second one. If someone have some idea how I could do all this stuff.

Sorry for the long post, I tried to be as much specific as I can.

Really appreciate your time & help, 

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables


How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration



Introduction to Talend Open Studio for Data Integration.


Downloads and Trials

Test drive Talend's enterprise products.