Reputation: 1
There is an FTP server. On that server there are two folders (Folder1 and Folder2). Folder1 contains 20 csv files (Total size more than 2 GB). I want to move all csv from Folder1 to Folder2. But I don't want to use TFTPGet and TFTPPut as it will take to too much time to upload.
Can anyone help me?
Upvotes: 0
Views: 4781
Reputation: 41
Yes, we can. You can use tFTPRename component and give fully specified file paths of different folders to the Filemask and New name fields.
Upvotes: 4
Reputation: 1154
There are two ways to accomplish this in Talend. If you wish to copy all contents in a directory, then you only need a tFileCopy component and check "Copy a Directory" specifying the source and destination directories.
If you need to copy only certain files in a directory, you can accomplish this in Talend using 2 components that work together. You need a tFileList and a tFileCopy, connecting them together with an Iterate flow.
Use the tFileList to generate your list of files from a specified directory. You can configure wildcards in the filemask section. For example, to only take .txt you would enter "*.txt" in the filemask section.
Then rightclick tFileList in the designer and click Row-->Iterate. Connect this to the FileCopy component. In FileCopy use this code in file name:
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
You have other options in the FileCopy component as well, including Remove Source File, and Create the Directory if it doesn't exist.
Select which of the two best suit your needs.
Upvotes: 0