Skip to Content
0
Mar 31, 2008 at 07:32 PM

parse file name from string

23 Views

Hi,

I am using FTP_COMMAND to get list of files from FTP server directory

  call function 'FTP_COMMAND'
    exporting
      handle        = hdl
      command       = 'ls /pub'  " << List of files in FTP dir
      compress      = compress
    tables
      data          = result
    exceptions
      command_error = 1
      tcpip_error   = 2.

I need to check whether file exist in the FTP server directory before i am going to write.

My problem after te FTP_COMMAND i am getting a result as mentioned below. So from this result i need to PARSE the filename separetely. I like to know any function module out there, it will give the filename parsed

ls /pub
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
drwxr-xr-x    9 40       20232        4096 May 24  2007 list
drwxrwxr-x    3 40       49           4096 Mar 31 14:57 details
-rw-rw-r      1 40       49          75597 Mar 31 13:23 yatt6010.2008022020080320.dat
-rw-rw-r      1 40       49          75597 Mar 31 13:28 yatt6010.2008022020080321.dat
226 Directory send OK.