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

Talend Big Data Studio User Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
task
Design and Development
EnrichPlatform
Talend Studio

This scenario describes how to use a routine. The Job uses just one component, which calls a system routine.

  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 FileName field, enter the path to access your file, or click [...] and browse the directory to locate the file.

  4. Close the double inverted commas around your file extension as follows: "D:/Input/customer".txt.

  5. Add the plus symbol (+) between the closing inverted commas and the file extension.

  6. 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.

  7. Modify the format of the date provided by default, if required.

  8. Enter the plus symbol (+) next to the getDate variable to complete the routine call, and place double inverted commas around the file extension.

    Warning

    If you are working on windows, the ":" between the hours and minutes and between the minutes and seconds must be removed.

  9. 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.