Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
AndyBrown
Contributor
Contributor

Retrieving Latest Files From FTP (Java)

I have an FTP account from which I must retrieve the most recent version for four different files. Every day our data source posts four different files with a datestamp appended to the end of the filename... Ex:
idns.txt.11310
lim.txt.11310
sbo.txt.11310
epf.txt.11310
NOTE: The datestamp is mmddyy where mm is a single or double digit, dd is the day, yy is the two-digit year.
If my process does not run for 5 days, I'll end up with 20 files in the directory.
I'm assuming I'll need to use a tFTPFileList and potentially tFileProperties to iterate over all files, but how do I compare datestamps to obtain the 'most recent' version of each of the four file types?
Labels (2)
12 Replies
AndyBrown
Contributor
Contributor
Author

What I ended up doing is to bring the files down to a temp directory using a tFTPFileList and a tSystem (using a curl command for each file), then iterating over the local files, moving them to my inbound directory. I'll delete the source files both locally and on the FTP server so I only have to process a handful each time. Until my FTP issue is identified, this shall be it.
Thanks for the assist.
jkrfs
Creator
Creator

Would love to check your job out if you're willing to share. Sounds like a good work around...
Anonymous
Not applicable

hey,
please i have problem
my team is working at BI prject with talend to retrieve data from datasource using ftp servers to another place, please if anyone can help me and tell me how this processus work ??