Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I need to create folders with timestamp for my project. I am looking for an option or a way to create folders with timestamp
Regards,
AK
Hello,
You can set the content of the context variable in the running job by using the "Context Load" component.
At the start of the job insert a tfileinputdelimited Component and a "Context Load" Component.
Establish a "main" link from tfileinputdelimited to the ContextLoad and set the schema of the tfileinputdelimited as Key and Value which is equal to the ContextLoad. In the "key" Field enter a String with the name of your context variable. In the value field enter the Expression TalendDate.formatDate("yyyyMMdd_HHmm",TalendDate.getCurrentDate()).
When you run the job, the context will be set dynamically with the actual time in the given format.
Here is online component reference about: TalendHelpCenter: tContextLoad
Best regards
Sabrina
Thanks Sabrrina. This would still create the filename with timestamp, but i would like know if any option or custom component to set the context folder with timestamp.
Cheers,
AK
Hello,
Could you please elaborate your case with an example with expected output values?
Best regards
Sabrina
I prefer using tSystem component with the OS specific commands (for permissions)...
eg: mkdir folderName_<context.timestamp>
or try this:
https://help.talend.com/r/wDRBNUuxk629sNcI0dNYaA/LVyqOf5jpvzw3jzwz3wTJw
Not the most elegant approach, but, does the work after deleting the file; the folder will still exist.