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.
Connect tFileList to tFileCopy using a Row >
Iterate link.
Double-click tFileList to open its Basic settings view.
In the Directory field, browse
to or type in the directory (D:/Input in this example) to
iterate upon.
Double-click tFileCopy to open its Basic settings view.
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")).
Set the destination directory by browsing to the
directory or type in the path to the directory in the Destination directory field.
Perform one of the following operations.
To move the files, select the Remove
source file check box, leave other options as they are.
To copy the files, make sure the Remove source
file check box is not selected, leave other options as they
are.
To rename the files, make sure the destination directory is the
current directory of the files, select the Rename option, type in the new filenames for the files in the
Destination filename field, and then select
the Remove source file option. The example
given in the following figure renames the files by prefixing the filenames with the
string renamed_.
Press Ctrl+S to save your Job and press
F6 to execute it.
You can check the files moved or copied in the destination
directory or check the renamed files in the source directory.
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!