Skip to main content Skip to complementary content

Use case: Creating a file for the current date

This scenario describes a one-component Job that calls a system routine to create an empty file with the date and time of creation in the file name.

Procedure

  1. In the Palette, click File > Management, then drop a tFileTouch component onto the workspace.
    This component allows you to create an empty file.
  2. Double-click the component to open its Basic settings view in the Component tab.
  3. In the File Name field, enter the path to the file to be created between double quotes, or click [...] and browse to an existing file, and modify the file name if needed.
  4. Add a plus symbol (+) in the File Name field.
  5. Press Ctrl+Space to open a list of all of the routines, and in the auto-completion list which appears, select TalendDate.getDate to use the Talend routine which allows you to obtain the current date.
  6. Modify the format of the date provided by default, if required.
    Information noteWarning: If you are working on Windows, the ":" characters in the time format are not allowed in file names and must be removed or replaced.
  7. Add another plus symbol (+) and then enter the file extension between double quotes.
  8. Press F6 to run the Job.

Results

The tFileTouch component creates an empty file with the creation date and time in the file name as specified in the File Name field.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!