ismail md
ismail md

Reputation: 1

Can we move files from one folder to another in FTP server using Talend DI open studio?

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

Answers (2)

Adrián
Adrián

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.

tFTPRename example to move file on FTP server

Upvotes: 4

E LaRoche
E LaRoche

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

Related Questions