Scenario: Restoring files from bin - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

This scenario describes a Job that iterates on a list of files in a directory, copies each file to a defined target directory, and then removes the copied files from the source directory.

  1. Create a new Job and add a tFileList component and a tFileCopy component by typing their names in the design workspace or dropping them from the Palette.

  2. Connect tFileList to tFileCopy using a Row > Iterate link.

  3. Double-click tFileList to open its Basic settings view.

  4. In the Directory field, browse to or type in the directory to iterated upon.

  5. Double-click tFileCopy to open its Basic settings view.

  6. In the File Name field, press Ctrl+Space to access the global variable list and select the tFileList_1.CURRENT_FILEPATH variable from the list to fill the field with ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).

  7. In the Destination directory field, browse to or type in the directory to copy each file to.

  8. Select the Remove source file check box to get rid of the files that have been copied.

  9. Press Ctrl+S to save your Job and press F6 to execute it.

    All the files in the defined source directory are copied to the destination directory and are removed from the source directory.