cancel
Showing results for 
Search instead for 
Did you mean: 

Pick Single file from FTP

Former Member
0 Kudos

Hi All ,

We have a requirement that we have to poll from one FTP Folder , that particular folder  can have multiple file with same file name but with different time stamps .

We have to pick only the latest file while ignoring all the other files present there .

Any Suggestion ?

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184720
Active Contributor
0 Kudos

May be better way is to discuss with your sender and see if they can overwrite instead of creating a new file every time.

if that's not possible,you may want to try something like below(if you don't want to deal with scripts),

Trigger/Request(Proxy/dummy file) -> mapping (File lookup  java UDF -> read content) -> receiver.

In the file lookup UDF, you can handle

-> getting the last modified file

->setting the other files to read only/delete them

Former Member
0 Kudos

hello,

there is no standard format in adapter to do this, we have to follow work around.

write OS script for this, below are the links for the same

If unix you can see an example script here:

http://www.computing.net/answers/dos/batch-file-to-rename-files-by-date/5517.html

If windows an example here:

http://en.kioskea.net/forum/affich-87157-finding-and-using-file-date-in-batch-command

You may need to change slightly to fit your exact requirements. But this would make you to start. Else you can also google to get the script. Here is one link:

http://www.google.com/#hl=en&source=hp&q=scripttorenamefileshavingtodaysdate&aq=f&aqi=m1&aql=&oq=&gs_rfai=CRE9SwTMsTNjiDpzGhgTm65iFCwAAAKoEBU_QC2i-&fp=e0fa4b5da4f245a4