Tuesday, June 2, 2015

How to Download Files From FTP Server Using Talend !!

In this post I will show you how to extract files or get files from FTP server using Talend.
In the given scenario we assume that we don’t know the exact names of the files to be downloaded from the remote location and we just know the extensions type and the path of the incoming files .

As an ETL developer we know most of the time data comes in multiple format through FTP and we need to process the data to keep the business running. In this post will try to give an idea how we can process the data to achieve our desired data. I will be showing how to get the file from FTP and UnArchive the file. Once Archived file is available you can push that data into the database as per you required business rules.

Drag and drop the following component from the palette :-
tFTPConnection , tFTPGet , tFileList , tFileUnarchive.
Connect each component as shown in the screenshot below.



tFTPConnection creates a connection to your FTP server.
Open the component properties of tFTPConnection and fill the Host name , Port , Username and Password field.


You can also create the FTP connection under MetaData repository

Open the component properties of tFileGet and fill the Local Directory path where you want to copy the files and remember it should always be in double quotes "".
And fill the path of incoming files in the Remote Directory .
In the Files list using Filemask specify all the types of files you want to retrieve from the remote server by clicking + button.



In the tFileList component fill the Directory path and Filemask of the files same as you gave in the tFileGet component local directory path and filemask.


Now tFileList component is connected with Iterate link to tFileUnarchive component so that all the files one by one get archive.

Open the component properties of tFileUnarchive.
In the Archive File field provide the path of the tFileList.
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

Or you can press ctrl + space key and select tFileList_1_CURRENT_FILEPATH.




Atlast when you Run the job all the files get retrieved in your local directory which you have given with mentioned extensions.

4 comments:

  1. Hi thank u for this article.. It was very help full. No other blog has this kind of simple and well explained way. thank you so much.. :)

    ReplyDelete
  2. It's really excellent blog, I just share your blog because it's really nice. Just look at this MSBI Online Course

    ReplyDelete