<?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: Get two latest files from ftp directory in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208208#M7528</link>
    <description>&lt;A href="https://community.qlik.com/s/profile/00539000006eKOgAAM"&gt;@nthampi&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Thank you for your response. 
&lt;BR /&gt;I am new to talend. Can you show me how to group the files to different groups based on file names please? 
&lt;BR /&gt; 
&lt;BR /&gt;Best regards, 
&lt;BR /&gt;Asadasing</description>
    <pubDate>Tue, 30 Oct 2018 15:02:20 GMT</pubDate>
    <dc:creator>RA6</dc:creator>
    <dc:date>2018-10-30T15:02:20Z</dc:date>
    <item>
      <title>Get two latest files from ftp directory</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208206#M7526</link>
      <description>&lt;P&gt;Hello folks,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am trying to retrieve two last files below [&lt;STRONG&gt;different names&lt;/STRONG&gt;] from an ftp directory.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Expected result :&lt;/P&gt; 
&lt;P&gt;Lastest File 1 : Clients_26102018.csv&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Lastest&amp;nbsp;&lt;/SPAN&gt;File 2 : Ecritures_26102015.csv&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 642px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0j9.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156231i4052F7B2B2306A0A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0j9.png" alt="0683p000009M0j9.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Based on the tftpfileproperties, i have filtered the mtime by desc and fetching the first row and i am retrieving my first file =&amp;gt;&amp;nbsp;&lt;SPAN&gt;Clients_26102018.csv&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;As you can see, i am using filemask "Client_*.csv" to retrieve the file.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Apart from&amp;nbsp;duplicating the same job for the other file,&amp;nbsp;I want to know if there is another way to achieve this.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;something like foreach parameters? The only thing thing that is changing&amp;nbsp; is the file mask.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Or is there way to retrieve both files in one job?&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;IMG src="https://community.qlik.com/" border="0" width="640" height="228" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture3.PNG" style="width: 759px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0e1.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155460iE83A1E77E626B3A6/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0e1.png" alt="0683p000009M0e1.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Best regards,&lt;/P&gt; 
&lt;P&gt;Ashish&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:23:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208206#M7526</guid>
      <dc:creator>RA6</dc:creator>
      <dc:date>2024-11-16T07:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get two latest files from ftp directory</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208207#M7527</link>
      <description>&lt;P&gt;Hi Ashish,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Why don't you fetch all the file property details to buffer by giving the file mask as "*"? Once you get the file details, you can group the files to different groups based on file names (you will need some regex/substring function here based on your use case) and pick the file with oldest date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Once the required file is identified in each group, you can do file fetch for only those files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Warm Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nikhil Thampi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 14:33:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208207#M7527</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-29T14:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get two latest files from ftp directory</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208208#M7528</link>
      <description>&lt;A href="https://community.qlik.com/s/profile/00539000006eKOgAAM"&gt;@nthampi&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Thank you for your response. 
&lt;BR /&gt;I am new to talend. Can you show me how to group the files to different groups based on file names please? 
&lt;BR /&gt; 
&lt;BR /&gt;Best regards, 
&lt;BR /&gt;Asadasing</description>
      <pubDate>Tue, 30 Oct 2018 15:02:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208208#M7528</guid>
      <dc:creator>RA6</dc:creator>
      <dc:date>2018-10-30T15:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get two latest files from ftp directory</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208209#M7529</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;First of all my sincere apologies for responding back. I am currently on vacation but thought to update this post as per my promise.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;I have created the current flow using tFIlelist in local but you can create the same logic for FTP flow also using tFTP components.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Below are the sample files I have created and my intention is to pick the latest files(highlighted) based on file creation timestamp.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 893px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0pC.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157691i5A8E4DBEB976732D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0pC.png" alt="0683p000009M0pC.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;The job flow below is picking the files and the last subjob can be used (instead of tfileproperties_2, you can use other components) to process them further.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0b1.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146545i0965C1F3F13A368B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0b1.png" alt="0683p000009M0b1.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am attaching the job for your reference. It is quite self explanatory. The only change you need to do is to use the FTP components for file list and reading.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If the answer has helped you, could you please mark the topic as resolved? Kudos are also welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Nikhil Thampi&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lu59"&gt;child.zip&lt;/A&gt;</description>
      <pubDate>Fri, 02 Nov 2018 10:57:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208209#M7529</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-02T10:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get two latest files from ftp directory</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208210#M7530</link>
      <description>Genius!! 
&lt;BR /&gt;Thank you 
&lt;A href="https://community.qlik.com/s/profile/00539000006eKOgAAM"&gt;@nthampi&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Best regards, 
&lt;BR /&gt;asadasing</description>
      <pubDate>Fri, 02 Nov 2018 11:26:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208210#M7530</guid>
      <dc:creator>RA6</dc:creator>
      <dc:date>2018-11-02T11:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get two latest files from ftp directory</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208211#M7531</link>
      <description>my version is 6.5.1</description>
      <pubDate>Sat, 03 Nov 2018 07:11:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-two-latest-files-from-ftp-directory/m-p/2208211#M7531</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-03T07:11:30Z</dc:date>
    </item>
  </channel>
</rss>

