About this task
This scenario describes how to use a routine. The Job uses just one component, which calls a system routine.
- In the Palette, click File > Management, then drop a tFileTouch component onto the workspace. This component allows you to create an empty file.
- Double-click the component to open its Basic settings view in the Component tab.
In the FileName field, enter the path to access
your file, or click [...] and browse the directory
to locate the file.
- Close the double inverted commas around your file extension as follows: "D:/Input/customer".txt.
- Add the plus symbol (+) between the closing inverted commas and the file extension.
- Press Ctrl+Space to open a list of all of the routines, and in the auto-completion list which appears, select Talend Date.getDate to use the Talend routine which allows you to obtain the current date.
- Modify the format of the date provided by default, if required.
Enter the plus symbol (+) next to the getDate variable to
complete the routine call, and place double inverted commas around the file
Warning: If you are working on windows, the ":" between the hours and minutes and between the minutes and seconds must be removed.
Press F6 to run the Job.
The tFileTouch component creates an empty file with the days date, retrieved upon execution of the GetDate routine called.