Question

How to get Most recent file from FTP server/directory

  • 23 October 2019
  • 1 reply
  • 34 views

Badge

Hello Friends,

 

I have a requirement to load most recent ( latest file) from FTP server into a table in Oracle DB.

e.g. the file name will be something like this "inbound_fdw_dom_20191003014842" which is ( filename_yyyymmddhhmmss) . The file will be in .csv format.

my issue is, what to do in FME to get latest file. Since I am learning and new to FME tool, could some one show me step by step information or picture will help me a lot. Sorry, I may be asking too much detail but I am learning so need help here. Thank you in advance for your help.

 

Thank you,

Vpat


1 reply

Userlevel 4
Badge +26

Hi @vipulpatel78,

 

 

So part of the difficulty here is that there is no easy way to list all of the files on a ftp server with FME. This means it will be tricky to get the latest version.

 

 

Thankfully there has been a lot of discussion on how to do this with Python withing FME here: https://knowledge.safe.com/questions/35179/use-pythoncaller-to-get-list-of-files-in-directory.html

 

 

This should get you at least to the point of being able to read the list of files on the FTP. One step closer. The next step will be to parse the file names and extract the yyyymmddhhmmmss from the file name. Once you have the list coming into FME properly then we can look at that step.

 

 

Have a read of that thread to get some tips.

 

 

Good luck with the first step!

 

 

 

Reply