<?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 Scan folder and move most recent file in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Scan-folder-and-move-most-recent-file/m-p/1578067#M456749</link>
    <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to use Qlikview to scan a folder where we have different files&lt;/P&gt;&lt;P&gt;like A-xxxx, A-yyyyy, B-zzzzz&lt;/P&gt;&lt;P&gt;I'd like in the load script to only read and process the most recent A- or B- file&lt;/P&gt;&lt;P&gt;By most recent I mean the greater number after A- or B- or C- etc...&lt;/P&gt;&lt;P&gt;By doing that I'd also like the most recent files to be moved in a different folder then be loaded in Qlik while the file that have not been read moved to another file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no clue how to start on this question so any help would be great.&lt;/P&gt;&lt;P&gt;Enclosed is a zip containing an examples of files and architecture of the folder I use&lt;/P&gt;&lt;P&gt;In advance thank you for your help.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 20:54:56 GMT</pubDate>
    <dc:creator>Hakisback</dc:creator>
    <dc:date>2024-11-16T20:54:56Z</dc:date>
    <item>
      <title>Scan folder and move most recent file</title>
      <link>https://community.qlik.com/t5/QlikView/Scan-folder-and-move-most-recent-file/m-p/1578067#M456749</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to use Qlikview to scan a folder where we have different files&lt;/P&gt;&lt;P&gt;like A-xxxx, A-yyyyy, B-zzzzz&lt;/P&gt;&lt;P&gt;I'd like in the load script to only read and process the most recent A- or B- file&lt;/P&gt;&lt;P&gt;By most recent I mean the greater number after A- or B- or C- etc...&lt;/P&gt;&lt;P&gt;By doing that I'd also like the most recent files to be moved in a different folder then be loaded in Qlik while the file that have not been read moved to another file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no clue how to start on this question so any help would be great.&lt;/P&gt;&lt;P&gt;Enclosed is a zip containing an examples of files and architecture of the folder I use&lt;/P&gt;&lt;P&gt;In advance thank you for your help.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:54:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scan-folder-and-move-most-recent-file/m-p/1578067#M456749</guid>
      <dc:creator>Hakisback</dc:creator>
      <dc:date>2024-11-16T20:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Scan folder and move most recent file</title>
      <link>https://community.qlik.com/t5/QlikView/Scan-folder-and-move-most-recent-file/m-p/1578371#M456750</link>
      <description>&lt;P&gt;You could use a dirlist/filelist loop to get all files with a certain name-pattern and within the loop you could further check parts of it and/or using them within file-functions like filetime(). Here an example which just checked if the name-part is bigger as the default value but it shouldn't be too difficult to adapt it to your requirement:&lt;/P&gt;&lt;P&gt;for each vFile in filelist('$(pApp@L11@QVD)Rawdata_*.qvd')&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if subfield(subfield('$(vFile)', '.', -2), '_', -1) &amp;gt;= 201901 then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rawdata: load * FROM [$(vFile)] (qvd);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end if&lt;BR /&gt;next&lt;/P&gt;&lt;P&gt;In your case you may not load the data within the loop else just using it to store the latest file-name and so on within variables which are then used to load and move the files. For moving the files you could use EXECUTE to start a cmd which moves/copies the files - an example could you find here: &lt;A href="https://community.qlik.com/t5/QlikView-Scripting/EXECUTE-command-to-move-files-listed-in-an-XLSX-or-TXT/m-p/101357" target="_self"&gt;EXECUTE-command-to-move-files-listed-in-an-XLSX-or-TXT&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 11:09:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scan-folder-and-move-most-recent-file/m-p/1578371#M456750</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-05-09T11:09:20Z</dc:date>
    </item>
  </channel>
</rss>

