Databases Reference
In-Depth Information
11. You can see that the Studio completes the parameter value with a globalMap
variable—in this case, tFileList_1_CURRENT_FILEPATH , which denotes
the current filename and its directory path.
12. Now right-click on the delimited input, select Row | Main , and drop the
connector onto the delimited output.
13. Change the File Name of the delimited output component to fileconcat-
out.txt in our target directory and check the Append checkbox, so that the
Studio adds the data from each iteration to the bottom of each file. If Append
is not checked, then the Studio will overwrite the data on each iteration and
all that will be left will be the data from the final iteration.
14. Run the job and check the output file in the target directory. You will see a
single file with the contents of the five original files in it. Note that the Studio
shows the number of iterations of the file list component that have been
executed, but does not show the number of lines written to the output file,
as we are used to seeing in non-iterative jobs.
Checking for files
Let's look at how we can check for the existence of a file before we undertake an
operation on it. Perhaps the first question is "Why do we need to check if a file exists?"
To illustrate why, open the FileDelete job that we created earlier. If you look at
its component configuration, you will see that it will delete a file named file-to-
delete.txt in the Source directory. Go to this directory using your computer's file
explorer and delete this file manually. Now try to run the FileDelete job. You will
get an error when the job executes:
 
Search WWH ::




Custom Search