-
Book Overview & Buying
-
Table Of Contents
Talend Open Studio Cookbook
By :
Some organizations prefer to use a companion (control/validation) file containing file information instead of storing the information in the file header or trailer. This means that the detail file is much simpler to process, because it is a normal flat file.
In this recipe, the control file has the same name as the detail file; however, it is suffixed with .ctrl rather than .txt. This recipe shows how the control file is processed.
Open the jo_cook_ch08_0130_controlFile job. You will see that tFileList_1 is looking for files with the mask of chapter08_jo_0130_customerData*.txt. There are two of these in the directory.
The steps for processing control/validation files
Copy the first sub job.
Change the new tFileList mask to StringHandling.EREPLACE(((String)globalMap.get("tFileList_1_CURRENT_FILE")),"txt","ctrl").
Open tJava_2 and change the command to System.out.println("Found control file: "+((String)globalMap.get("tFileList_2_CURRENT_FILE...