Use case: Creating a file for the current date - 7.3

Talend Open Studio User Guide

Version
7.3
Language
English
Product
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Module
Talend Studio
Content
Design and Development
Last publication date
2023-10-11
Available in...

Open Studio for Big Data

Open Studio for Data Integration

Open Studio for ESB

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.
    Warning: 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.