Moving, copying, renaming, and deleting files and folders
As well as reading from and writing to files, Talend has a set of components that allow developers to perform file functions without the need to call native operating system commands. This recipe shows the basic file management components.
Getting ready
Open the job jo_cook_ch08_0100_basicFileCommands
.
How to do it...
In the following recipes, it is worth noting that Talend uses the Linux style forward slash (/) in the file paths, as opposed to the Windows backslash (\).
Copying a file to another directory
- Drag
tFileCopy
to the job. - Set the file name to be
context.cookbookData+"/chapter8/chapter08_jo_0100_copyFile.txt"
. - Set the output directory to be
context.cookbookData+"/outputData/chapter8" ...
Get Talend Open Studio Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.