Can I use tMap to filter folders from a FTP server?

Seven Stars

Can I use tMap to filter folders from a FTP server?

I wanted to copy certain folders from a FTP server to my local computer.

Here is the Talend components I used:

Capture.PNG

1. tFTPConnection

2. tFTPFileList       -- with the filemask in tFTPFileList, I was able exclude some unwanted folders. In order to exclude all the unwanted files, I used another 2 components:

 

3. tIterateToFlow:

    filename: ((String)globalMap.get("tFTPFileList_4_CURRENT_FILE"))     -- in this case, the filename is the folder name

    filepath:   ((String)globalMap.get("tFTPFileList_4_CURRENT_FILEPATH"))

4. tMap:    

    use a filter to exclude unwanted file:  !row9.filename.equals("here is the unwanted folder name")

 

Now if I link tMap's output to tLogRow, I can see the unwanted filenames (folder names) are all gone.

 

But my question is, how to copy the correct foldes after tMap? Can I just connect tMap to tFTPGet? What should I  do now?

 

Thanks!


Accepted Solutions
Highlighted
Community Manager

Re: Can I use tMap to filter folders from a FTP server?

link tMap to a tFlowToIiterate to iterate each folder, eg:
...tMap--tflowToIterate--iterate--tFTPGet.
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Forteen Stars

Re: Can I use tMap to filter folders from a FTP server?

@TigerMommy,from tMap,wirite it it file ,tHashOutput or DB and again read that file and iterate the values and in tFTPGet call that global variable form iterated value as file-mask.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Highlighted
Community Manager

Re: Can I use tMap to filter folders from a FTP server?

link tMap to a tFlowToIiterate to iterate each folder, eg:
...tMap--tflowToIterate--iterate--tFTPGet.
----------------------------------------------------------
Talend | Data Agility for Modern Business
Seven Stars

Re: Can I use tMap to filter folders from a FTP server?

Thank you shong!  It worked.

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download