<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: parse file name from string in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/parse-file-name-from-string/m-p/3579050#M861620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what i am looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You saved my day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Mar 2008 20:16:17 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2008-03-31T20:16:17Z</dc:date>
    <item>
      <title>parse file name from string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/parse-file-name-from-string/m-p/3579048#M861618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using FTP_COMMAND to get list of files from FTP server directory&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  call function 'FTP_COMMAND'
    exporting
      handle        = hdl
      command       = 'ls /pub'  " &amp;lt;&amp;lt; List of files in FTP dir
      compress      = compress
    tables
      data          = result
    exceptions
      command_error = 1
      tcpip_error   = 2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to check whether file exist in the FTP server directory before i am going to write.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
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.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 19:32:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parse-file-name-from-string/m-p/3579048#M861618</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-03-31T19:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: parse file name from string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/parse-file-name-from-string/m-p/3579049#M861619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT zz_temp.

DATA l_s_unix_dir(80)    TYPE c.
DATA l_t_unix_dir        LIKE TABLE OF l_s_unix_dir.
DATA l_v_regex(80)       TYPE c VALUE '\S+\s+\d+\s+\d+\s+\d+\s+\d+\s+\S+\s+\d+\s+(?:\d{4}|\d+:\d+)\s+(\S+)'.
DATA l_v_submatch(80)    TYPE c.


l_s_unix_dir = 'drwxr-xr-x    9 40       20232        4096 May 24  2007 list'.
APPEND l_s_unix_dir TO l_t_unix_dir.
l_s_unix_dir = 'drwxrwxr-x    3 40       49           4096 Mar 31 14:57 details'.
APPEND l_s_unix_dir TO l_t_unix_dir.
l_s_unix_dir =  '-rw-rw-r      1 40       49          75597 Mar 31 13:23 yatt6010.2008022020080320.dat'.
APPEND l_s_unix_dir TO l_t_unix_dir.
l_s_unix_dir =  '-rw-rw-r      1 40       49          75597 Mar 31 13:28 yatt6010.2008022020080321.dat'.
APPEND l_s_unix_dir TO l_t_unix_dir.


LOOP AT l_t_unix_dir INTO l_s_unix_dir.
  FIND FIRST OCCURRENCE OF REGEX l_v_regex IN l_s_unix_dir SUBMATCHES l_v_submatch.
  WRITE:/ l_v_submatch.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 20:08:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parse-file-name-from-string/m-p/3579049#M861619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-31T20:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: parse file name from string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/parse-file-name-from-string/m-p/3579050#M861620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what i am looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You saved my day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 20:16:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parse-file-name-from-string/m-p/3579050#M861620</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-03-31T20:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: parse file name from string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/parse-file-name-from-string/m-p/3579051#M861621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Happy to do it.  It is an ugly regex and I can probably do better.  But it is late and time to go home  &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 20:19:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parse-file-name-from-string/m-p/3579051#M861621</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-31T20:19:00Z</dc:date>
    </item>
  </channel>
</rss>

