Processing multiple files at once
Often, with batch processes, it is required that multiple files are processed by the same job in a single tranche. This example shows how this can be achieved by merging a group of input files into a single output.
Getting ready
Open the jo_cook_ch08_0120_multipleFiles
job. You will notice that it is currently reading a single file to a temporary file, and then copying the temporary fileto a permanent output.
How to do it...
The steps for processing multiple files at once are as follows:
Add a
tFileList
component, open it, and set the directory tocontext.cookbookData+"/chapter8"
.Click on the + button under the Filemask box, and add the filemask
"chapter08_jo_0120_customerData_*.txt"
.Your
tFileList
should look like the one shown, as follows:Move the
OnSubjobOk
from thetFileInputDelimited
to thetFileList
.Add a
tJava
component.Right-click on
tFileList
and select Row, then Iterate, and link to thetJava
.Right-click on the
tJava
and select Trigger, thenOnComponentOk...