<?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: How to get latest files in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344039#M111735</link>
    <description>&lt;P&gt;Can you please explain in detail, because file names may vary.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Feb 2018 05:29:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-02-07T05:29:47Z</dc:date>
    <item>
      <title>How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344035#M111731</link>
      <description>&lt;P&gt;How to get the latest file. when we run history. Can anyone please help to sort it out.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 11:42:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344035#M111731</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-06T11:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344036#M111732</link>
      <description>Have a look to tFileList component options to sort files based on chronological order with older first.</description>
      <pubDate>Tue, 06 Feb 2018 12:16:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344036#M111732</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-02-06T12:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344037#M111733</link>
      <description>&lt;P&gt;There is only modified in tfilelist.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my scenario I'm downloading all the history files in job server, but based on filedate it should process only latest date file.&lt;/P&gt;
&lt;P&gt;Eg: 1.Customersdata_20180126.psv&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 2.Customersdata_20180201.psv&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 3.Customersdata_20171231.psv&lt;/P&gt;
&lt;P&gt;We have to process only&amp;nbsp;&lt;SPAN&gt; 2.Customersdata_20180201.psv&lt;/SPAN&gt; file which is latest&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Venkat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 18:39:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344037#M111733</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-06T18:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344038#M111734</link>
      <description>Same answer based on filename. 
&lt;BR /&gt;Memorize the 1rst name using a global variable then reuse the variable in the next subjob to get the file.</description>
      <pubDate>Tue, 06 Feb 2018 20:13:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344038#M111734</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-02-06T20:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344039#M111735</link>
      <description>&lt;P&gt;Can you please explain in detail, because file names may vary.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 05:29:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344039#M111735</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-07T05:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344040#M111736</link>
      <description>&lt;P&gt;first put in the memory that the pattern of the file. and call the same pattern in to tFilelist.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1) pattern would be like this&amp;nbsp;globalMap.put("pattern", "&lt;SPAN&gt;Customersdata_&lt;/SPAN&gt;"+ TalendDate.getDate("yyyyMMdd") + pattern_suffixe);&lt;/P&gt; 
&lt;P&gt;2) use the same paatern to get see the below screen shot.&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 779px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ls8S.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139725iFBEF61DEC0E8A26A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ls8S.png" alt="0683p000009Ls8S.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;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 05:59:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344040#M111736</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2018-02-07T05:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344041#M111737</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;Stricly based on your filenames, here is a complete solution to get the latest file:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 350px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LsLy.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157753i46D028B494068E85/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LsLy.png" alt="0683p000009LsLy.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;tFileList is configured with the filemask "*.psv" and here is the content of the tJava component:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;// get the date contained into the current filename&lt;BR /&gt;int dateFile = Integer.parseInt(((String)globalMap.get("tFileList_2_CURRENT_FILE")).replaceAll("^.*_", "").replace(".psv", ""));&lt;BR /&gt;&lt;BR /&gt;// if there is no "maxDate" known or the current date is &amp;gt; to "maxDate" then the current date becomes the "maxDate"&lt;BR /&gt;if ((Integer)globalMap.get("maxDate") == null || dateFile &amp;gt; (Integer)globalMap.get("maxDate")) {&lt;BR /&gt;   globalMap.put("maxDate", dateFile);&lt;BR /&gt;   globalMap.put("lastFile", (String)globalMap.get("tFileList_2_CURRENT_FILE"));&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;P&gt;Now you can get the filename using the global variable called "lastFile" using the following syntax (for example to populate the Filename field of a tFileInputDelimited or tFileInputFullRow component):&lt;/P&gt; 
&lt;PRE&gt;(String)globalMap.get("lastFile")&lt;/PRE&gt; 
&lt;P&gt;This example is based on your input and works fine.&lt;/P&gt; 
&lt;P&gt;You may have to adapt it to your case.&lt;/P&gt; 
&lt;P&gt;Don't forget to mark your case as solved as soon as it is ok for you (Kudo also accepted).&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 09:35:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344041#M111737</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-02-07T09:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344042#M111738</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm very thankful for your detailed explanation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My filename is coming like this&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good_&lt;SPAN&gt;Customersdata_20171231_&lt;STRONG&gt;20171231092635&lt;/STRONG&gt;.psv&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In this file&amp;nbsp;20171231092635 is date with timestamp I can to check based on this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please help me to sort it&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 15:23:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344042#M111738</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-07T15:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344043#M111739</link>
      <description>&lt;P&gt;Just have to change the tJava code to use BigInteger instea of Int:&lt;/P&gt;&lt;PRE&gt;BigInteger dateFile = new BigInteger(((String)globalMap.get("tFileList_2_CURRENT_FILE")).replaceAll("^.*_", "").replace(".psv", ""));

if ((BigInteger)globalMap.get("maxDate") == null || dateFile.compareTo((BigInteger)globalMap.get("maxDate")) == 1) {
	globalMap.put("maxDate", dateFile);
	globalMap.put("lastFile", (String)globalMap.get("tFileList_2_CURRENT_FILE"));
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 17:36:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344043#M111739</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-02-07T17:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344044#M111740</link>
      <description>&lt;P&gt;It is showing BigInt cannot be resolved.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 18:24:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344044#M111740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-07T18:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344045#M111741</link>
      <description>&lt;P&gt;Add the following in the tJava component Advanced settings:&lt;/P&gt;&lt;PRE&gt;import java.math.*;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Feb 2018 19:25:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344045#M111741</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-02-07T19:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344046#M111742</link>
      <description>&lt;P&gt;did you try my solution?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 05:48:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344046#M111742</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2018-02-08T05:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344047#M111743</link>
      <description>&lt;P&gt;Thanks for your support&lt;/P&gt;&lt;P&gt;Actually I was confused, I tried but didn't understand&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 05:52:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344047#M111743</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-08T05:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344048#M111744</link>
      <description>&lt;P&gt;1) in tjava put below code.&lt;/P&gt;
&lt;P&gt;String pattern_suffixe = "*.csv";&lt;/P&gt;
&lt;P&gt;globalMap.put("yyyyMMdd", TalendDate.getDate("yyyy_MM_dd"));&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;globalMap.put("pattern", "&lt;/SPAN&gt;&lt;SPAN&gt;Customersdata_&lt;/SPAN&gt;&lt;SPAN&gt;"+ TalendDate.getDate("yyyyMMdd") + pattern_suffixe);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2) in tFilelist use the below parameter under the filemask.same which i have provided in screenshot in the first reply.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;((String)globalMap.get("pattern"))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 06:01:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344048#M111744</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2018-02-08T06:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344049#M111745</link>
      <description>&lt;P&gt;is my solution usefull?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 06:44:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344049#M111745</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2018-02-08T06:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344050#M111746</link>
      <description>&lt;P&gt;Finally you will be able to get the file with using the variable "lastFile" as a filename:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 760px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LsVi.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155735i2D8F812A43A7935B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LsVi.png" alt="0683p000009LsVi.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Now you got a complete solution for your case.&lt;/P&gt; 
&lt;P&gt;Don't forget to mark it as solved (Kudos also accepted).&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 07:19:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344050#M111746</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-02-08T07:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get latest files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344051#M111747</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your support, I will accept your solution.&lt;/P&gt;
&lt;P&gt;I found one simple way to get the latest file.&lt;/P&gt;
&lt;P&gt;In tfilelist&amp;nbsp; we have by filename instead of default and order by des.&lt;/P&gt;
&lt;P&gt;Then we will get latest file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 11 Feb 2018 09:37:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-latest-files/m-p/2344051#M111747</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-11T09:37:09Z</dc:date>
    </item>
  </channel>
</rss>

