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: 
_AnonymousUser
Specialist III
Specialist III

dynamic file name in FTPget

Hi, Please help.
I need to get the files "fill_*_tst.txt" from sFTP server.
When I specify the file name, it works. but I tried to create a dynamic name, it is not working in tFTPget.
HEre is the code I input in 'filemask", which can be wrong.
"fill_" + TalendDate.formatDate("yyyyMMdd", TalendDate.getCurrentDate()) + "_*_tst.txt"
How can I do that?
Thank you.
Labels (2)
15 Replies
_AnonymousUser
Specialist III
Specialist III
Author

Thanks. I am going to try that way.
One quick question, If I want to get Yesterday's date, TalendDate.getDate("YYYYMMDD") - 1 will work?
Anonymous
Not applicable

I haven't tried, am I'm not a java expert, but I suspect not.
I use TalendDate.addDate and a context variable to do this.
context.myDate = Calendar.getInstance().getTime();
context.myDate = TalendDate.addDate(context.myDate, -1, "dd");
_AnonymousUser
Specialist III
Specialist III
Author

TalendDate.addDate works. Thank you for all your help.
_AnonymousUser
Specialist III
Specialist III
Author

I am putting together a small POC using Talend toolkit (v5.0.1.r74687) and this example is is exactly what I'm looking to do, but when I run the job, it will not compile, giving me an error saying that "GregorianCalendar cannot be resolved to a type" and highlighting the tJava object (expectantly I guess) as to the source of the error.
Any pointers as to what I'm doing wrong would be most welcome as its the first hurdle in 3 days of playing with this software that I've been unable to resolve myself (with the help of talendforge and/or google anyway)
Anonymous
Not applicable

Try fully qualifying it, eg:
java.util.GregorianCalendar = new java.util.GregorianCalendar();
_AnonymousUser
Specialist III
Specialist III
Author

hi Yunee,
Could u paste the screen shot ofyour job here.