Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to get the latest file. when we run history. Can anyone please help to sort it out.
Add the following in the tJava component Advanced settings:
import java.math.*;
did you try my solution?
Thanks for your support
Actually I was confused, I tried but didn't understand
1) in tjava put below code.
String pattern_suffixe = "*.csv";
globalMap.put("yyyyMMdd", TalendDate.getDate("yyyy_MM_dd"));
globalMap.put("pattern", "Customersdata_"+ TalendDate.getDate("yyyyMMdd") + pattern_suffixe);
2) in tFilelist use the below parameter under the filemask.same which i have provided in screenshot in the first reply.
((String)globalMap.get("pattern"))
is my solution usefull?
Finally you will be able to get the file with using the variable "lastFile" as a filename:
Now you got a complete solution for your case.
Don't forget to mark it as solved (Kudos also accepted).
Hi ,
Thanks for your support, I will accept your solution.
I found one simple way to get the latest file.
In tfilelist we have by filename instead of default and order by des.
Then we will get latest file.
Thanks