Occasionally, it is necessary to create intermediate files within a job that are only used during the lifetime of the job. This recipe shows how to use Talend temporary files.
The steps for using temporary files are as follows:
Open the
tCreateFileTemporary
component, and change the name tocustomerTemp_XXXX
.Select the options Remove file when execution is over, and Use temporary system directory.
Open the
tempCustomerOut
component, and change File Name to((String)globalMap.get("tCreateTemporaryFile_1_FILEPATH"))
.Repeat the steps for the
tempCustomerIn
component.Run the job, and you will see that data is written to and read from the temporary file.