Databases Reference
In-Depth Information
4.
You will see the following value added to the textbox:
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
This global variable passes the value of the current file (and its path) through
the delimited input component. Note that the file list and its connection to
the delimited input are iterative, so, on each iteration, the delimited file input
is reading the "current" file.
5. When the job is executed, our current file is read and passed through the
tMap component. It is then written to a delimited output file. We can also
use a global variable here.
6. Click on the delimited output component. We want to configure the File
Name parameter so that processed files are output to a new directory and
the filename is modified to reflect that it has been processed. In the File
Name field, enter the following value (including q uotes):
"C:/Talend/Workspace/BEGINNERSGUIDE/DataOut/Chapter9/ processed_"
This is the "ixed" element of the path and filename for each processed file.
7.
Now drag-and-drop the Current File Name global variable from the Outline
window into the File Name box. Add a + sign between the fixed path and the
global variable to join the two elements together. Your final parameter value
sho uld be:
"C:/Talend/Workspace/BEGINNERSGUIDE/DataOut/Chapter9/
processed_"+((String)globalMap.get("tFileList_1_CURRENT_FILE"))
8. Run the job—the files will be picked up in turn and written to the output
directory, prefixing the filename with processed_ .
 
Search WWH ::




Custom Search