<?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 Load text file in folder with most recent Date Modified in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-text-file-in-folder-with-most-recent-Date-Modified/m-p/1796072#M1211223</link>
    <description>&lt;P&gt;Each day a new file is added to the folder&amp;nbsp;C:\Users\Daily Feed\. The filename is always the same except for the highlighted section in the script below. The highlighted section is the date MMDDYYY with a series of numbers after. The numbers after the date are always different. So each day I have to update my script with the new filename.&amp;nbsp; Is there a way to read only the most recent file in the folder based on the date in the file name or possible the Modified Date of the file?&lt;/P&gt;&lt;P&gt;LOAD @1,&lt;BR /&gt;@2,&lt;BR /&gt;@3 as [USER ID],&lt;BR /&gt;@4,&lt;BR /&gt;@5&lt;BR /&gt;FROM&lt;BR /&gt;[C:\Users\Daily Feed\Datafeed User and OU Feed results - &lt;STRONG&gt;03_31_2021_07_07_10-&lt;/STRONG&gt;Errors.txt]&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is spaces, msq, header is 76 lines)where (@4)='UserName';&lt;/P&gt;</description>
    <pubDate>Wed, 31 Mar 2021 14:51:18 GMT</pubDate>
    <dc:creator>mwscott1</dc:creator>
    <dc:date>2021-03-31T14:51:18Z</dc:date>
    <item>
      <title>Load text file in folder with most recent Date Modified</title>
      <link>https://community.qlik.com/t5/QlikView/Load-text-file-in-folder-with-most-recent-Date-Modified/m-p/1796072#M1211223</link>
      <description>&lt;P&gt;Each day a new file is added to the folder&amp;nbsp;C:\Users\Daily Feed\. The filename is always the same except for the highlighted section in the script below. The highlighted section is the date MMDDYYY with a series of numbers after. The numbers after the date are always different. So each day I have to update my script with the new filename.&amp;nbsp; Is there a way to read only the most recent file in the folder based on the date in the file name or possible the Modified Date of the file?&lt;/P&gt;&lt;P&gt;LOAD @1,&lt;BR /&gt;@2,&lt;BR /&gt;@3 as [USER ID],&lt;BR /&gt;@4,&lt;BR /&gt;@5&lt;BR /&gt;FROM&lt;BR /&gt;[C:\Users\Daily Feed\Datafeed User and OU Feed results - &lt;STRONG&gt;03_31_2021_07_07_10-&lt;/STRONG&gt;Errors.txt]&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is spaces, msq, header is 76 lines)where (@4)='UserName';&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 14:51:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-text-file-in-folder-with-most-recent-Date-Modified/m-p/1796072#M1211223</guid>
      <dc:creator>mwscott1</dc:creator>
      <dc:date>2021-03-31T14:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Load text file in folder with most recent Date Modified</title>
      <link>https://community.qlik.com/t5/QlikView/Load-text-file-in-folder-with-most-recent-Date-Modified/m-p/1796115#M1211232</link>
      <description>&lt;P&gt;Load a table of files using either Filelist() or Load * and then filter the list using some criteria like FileTime. Put the winner in a variable and use the variable as your file path in the Load. For example:&lt;/P&gt;&lt;P class="p1"&gt;&lt;FONT face="courier new,courier"&gt;TempFiles:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;First&lt;/SPAN&gt; 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;LOAD&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp; FilePath&lt;/SPAN&gt;() &lt;SPAN class="s1"&gt;as&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;FilePath&lt;/SPAN&gt;,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp; FileTime&lt;/SPAN&gt;() &lt;SPAN class="s1"&gt;as&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;FileTime&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;From&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;[*.txt]&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;(&lt;SPAN class="s1"&gt;fix&lt;/SPAN&gt;, &lt;SPAN class="s1"&gt;utf8&lt;/SPAN&gt;, &lt;SPAN class="s1"&gt;no&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;labels&lt;/SPAN&gt;)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;TempLatest:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;Load&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp; FirstSortedValue&lt;/SPAN&gt;(&lt;SPAN class="s1"&gt;DISTINCT&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;FilePath&lt;/SPAN&gt;, -&lt;SPAN class="s2"&gt;FileTime&lt;/SPAN&gt;) &lt;SPAN class="s1"&gt;as&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;LatestFile&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;Resident&lt;/SPAN&gt; TempFiles&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;LET&lt;/SPAN&gt; vLatestFile = &lt;SPAN class="s1"&gt;peek&lt;/SPAN&gt;('LatestFile');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;DROP&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;Tables&lt;/SPAN&gt; TempFiles, TempLatest;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="Apple-converted-space"&gt;LOAD ... FROM [$(vLatestFile)] ...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;-Rob&lt;BR /&gt;&lt;A href="http://masterssummit.com" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://qlikviewcookbook.com" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.easyqlik.com" target="_blank"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 17:02:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-text-file-in-folder-with-most-recent-Date-Modified/m-p/1796115#M1211232</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2021-03-31T17:02:25Z</dc:date>
    </item>
  </channel>
</rss>

