Skip to main content
Solved

How to download multiple zip files from linux server in local starting with same prefix name (e.g. ARESFF01.341,ARESFF01.342, etc) with sftp in fme?Can we use FTPCaller?If so, how? If we can do it other way also kindly suggest.


How to download multiple zip files from linux server in local starting with same prefix name (e.g. ARESFF01.341,ARESFF01.342, etc) with sftp in fme?Can we use FTPCaller?If so, how? If we can do it other way also kindly suggest.

Best answer by caracadrian

Use FTPCaller to list all files in ftp folder. Set FTPCallet to Transfer Type: Download to an Attribute (URL must end in /).

Use two steps to split the _file_contents attribute: AttributeSplitter by CRLF + ListExploder and AttributeSplitter by splace " " + ListIndexer set to -1 to select the last element in the list.

StringSearcher on desired string (as in your example, use Regular expression ^ARESFF - begins with ARESFF).

Send the output from Matched port to a second FTPCaller set to the initial URL concatenated with the result of the result of StringSearcher and Transfer Type: Download to a file.

View original
Did this help you find an answer to your question?

3 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • Best Answer
  • August 2, 2022

Use FTPCaller to list all files in ftp folder. Set FTPCallet to Transfer Type: Download to an Attribute (URL must end in /).

Use two steps to split the _file_contents attribute: AttributeSplitter by CRLF + ListExploder and AttributeSplitter by splace " " + ListIndexer set to -1 to select the last element in the list.

StringSearcher on desired string (as in your example, use Regular expression ^ARESFF - begins with ARESFF).

Send the output from Matched port to a second FTPCaller set to the initial URL concatenated with the result of the result of StringSearcher and Transfer Type: Download to a file.


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • August 2, 2022
caracadrian wrote:

Use FTPCaller to list all files in ftp folder. Set FTPCallet to Transfer Type: Download to an Attribute (URL must end in /).

Use two steps to split the _file_contents attribute: AttributeSplitter by CRLF + ListExploder and AttributeSplitter by splace " " + ListIndexer set to -1 to select the last element in the list.

StringSearcher on desired string (as in your example, use Regular expression ^ARESFF - begins with ARESFF).

Send the output from Matched port to a second FTPCaller set to the initial URL concatenated with the result of the result of StringSearcher and Transfer Type: Download to a file.

I also atached a sample worksace to get you on your path.


caracadrian wrote:

I also atached a sample worksace to get you on your path.

Thanks it worked with little modification in my case.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings