<?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 How to get the latest file from a directory? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-latest-file-from-a-directory/m-p/2345201#M112760</link>
    <description>&lt;P&gt;I have following 4 files as an example in c:\temp directory and would like to get the latest file to load to the sql server database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to design a job to get the latest file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;File format:  filename_yyyyMMdd_HHmmss.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test_20230201_092511.csv&lt;/P&gt;&lt;P&gt;Test_20230201_093025.csv&lt;/P&gt;&lt;P&gt;Test_20230201_095010.csv&lt;/P&gt;&lt;P&gt;Test_20230201_095515.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 22:08:48 GMT</pubDate>
    <dc:creator>rp2018</dc:creator>
    <dc:date>2024-11-15T22:08:48Z</dc:date>
    <item>
      <title>How to get the latest file from a directory?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-latest-file-from-a-directory/m-p/2345201#M112760</link>
      <description>&lt;P&gt;I have following 4 files as an example in c:\temp directory and would like to get the latest file to load to the sql server database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to design a job to get the latest file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;File format:  filename_yyyyMMdd_HHmmss.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test_20230201_092511.csv&lt;/P&gt;&lt;P&gt;Test_20230201_093025.csv&lt;/P&gt;&lt;P&gt;Test_20230201_095010.csv&lt;/P&gt;&lt;P&gt;Test_20230201_095515.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 22:08:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-latest-file-from-a-directory/m-p/2345201#M112760</guid>
      <dc:creator>rp2018</dc:creator>
      <dc:date>2024-11-15T22:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest file from a directory?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-latest-file-from-a-directory/m-p/2345202#M112761</link>
      <description>&lt;P&gt;Hello @Ranjan Patel​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Maybe you can design the job like :&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;use tFileList to list all the csv files in the folder and sort by filename 'DESC' as the below &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;            &lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000cgnSeAAI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139834i3279FF51785543A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000cgnSeAAI.png" alt="0695b00000cgnSeAAI.png" /&gt;&lt;/span&gt;       2 add the tJava to get the top 1 file path and setup context variable "latest_file_path" to save it as the below&lt;/P&gt;&lt;P&gt;             &lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000cgnTSAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140884iAA15823786A4C4CE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000cgnTSAAY.png" alt="0695b00000cgnTSAAY.png" /&gt;&lt;/span&gt;     3 add tFileInputDelimited to read the file path context.latest_file_path and send the content to sqlserver db by tDBOutput as the below&lt;/P&gt;&lt;P&gt;       &lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000cgnUBAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140184i718BEB9317277400/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000cgnUBAAY.png" alt="0695b00000cgnUBAAY.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 02:57:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-latest-file-from-a-directory/m-p/2345202#M112761</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-02T02:57:56Z</dc:date>
    </item>
  </channel>
</rss>

