<?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: Loading file names from a single directory in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1601024#M444277</link>
    <description>&lt;P&gt;That code seems like overkill, unless you have a need for all the loops and excess, you can accomplish what you need with the following. Or you could use the code and modify it slightly to fit the need of your subroutine:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//step 1 - set variables&lt;/P&gt;&lt;P&gt;let vRootDir = 'Q:\QlikWarehouse\Production\Source Documents\Load Scripts\';&lt;/P&gt;&lt;P&gt;//step 2 - loop through group folders and collect file info in each&lt;/P&gt;&lt;P&gt;MyFiles:&lt;BR /&gt;LOAD Distinct&lt;BR /&gt;FileBaseName() as FileBaseName,&lt;BR /&gt;FileSize() as FileSize,&lt;BR /&gt;FileName() as FileName,&lt;BR /&gt;FileDir() as FileDirectory&lt;BR /&gt;from $(vRootDir)*.qvw (txt, codepage is 1252, no labels, delimiter is '\t', msq);&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2019 16:51:22 GMT</pubDate>
    <dc:creator>olivetwist</dc:creator>
    <dc:date>2019-07-10T16:51:22Z</dc:date>
    <item>
      <title>Loading file names from a single directory</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1600622#M444247</link>
      <description>&lt;P&gt;Can someone tell me why not all of my file names are being loaded from my directory when I use this script logic in QlikView 12?&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;//step 1 - set variables&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let vRootDir = 'Q:\QlikWarehouse\Production\Source Documents\Load Scripts\';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;//step 2 - loop through group folders and collect file info in each&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sub DoDir (Root)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;for each Ext in 'qvw'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;for each File in filelist (Root &amp;amp; '\*.' &amp;amp; Ext)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;MyFiles:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;FileBaseName('$(File)') as FileBaseName,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;FileSize('$(File)') as FileSize,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;FileName('$(File)') as FileName,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;FileDir('$(File)') as FileDirectory&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;from '$(File)' &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;next File&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;next Ext&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;for each Dir in dirlist (Root &amp;amp; '\*' )&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;call DoDir (Dir)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;next Dir&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;end sub&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;call DoDir ('$(vRootDir)')&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:03:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1600622#M444247</guid>
      <dc:creator>kdmarkee</dc:creator>
      <dc:date>2024-11-16T03:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Loading file names from a single directory</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1600859#M444264</link>
      <description>&lt;P&gt;My first question is why use the line "&lt;STRONG&gt;for each Ext in 'qvw'"?&lt;/STRONG&gt;&amp;nbsp;Are you planning to add additional extensions?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 11:11:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1600859#M444264</guid>
      <dc:creator>olivetwist</dc:creator>
      <dc:date>2019-07-10T11:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Loading file names from a single directory</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1600908#M444266</link>
      <description>&lt;P&gt;You query only qvw-files - are you really missing a qvw within your results?&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 12:34:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1600908#M444266</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-07-10T12:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Loading file names from a single directory</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1601001#M444276</link>
      <description>&lt;P&gt;I'm expecting 10 files and only get 5 to load.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 15:42:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1601001#M444276</guid>
      <dc:creator>kdmarkee</dc:creator>
      <dc:date>2019-07-10T15:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Loading file names from a single directory</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1601024#M444277</link>
      <description>&lt;P&gt;That code seems like overkill, unless you have a need for all the loops and excess, you can accomplish what you need with the following. Or you could use the code and modify it slightly to fit the need of your subroutine:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//step 1 - set variables&lt;/P&gt;&lt;P&gt;let vRootDir = 'Q:\QlikWarehouse\Production\Source Documents\Load Scripts\';&lt;/P&gt;&lt;P&gt;//step 2 - loop through group folders and collect file info in each&lt;/P&gt;&lt;P&gt;MyFiles:&lt;BR /&gt;LOAD Distinct&lt;BR /&gt;FileBaseName() as FileBaseName,&lt;BR /&gt;FileSize() as FileSize,&lt;BR /&gt;FileName() as FileName,&lt;BR /&gt;FileDir() as FileDirectory&lt;BR /&gt;from $(vRootDir)*.qvw (txt, codepage is 1252, no labels, delimiter is '\t', msq);&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 16:51:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1601024#M444277</guid>
      <dc:creator>olivetwist</dc:creator>
      <dc:date>2019-07-10T16:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Loading file names from a single directory</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1601087#M444284</link>
      <description>&lt;P&gt;Thank you, that seems to work.&amp;nbsp; I was just trying different scripting code I found on the Community to get my files loaded, and although what I tried was more involved, I guess I'm still curious as to why it didn't work.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 19:36:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1601087#M444284</guid>
      <dc:creator>kdmarkee</dc:creator>
      <dc:date>2019-07-10T19:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Loading file names from a single directory</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1601345#M444313</link>
      <description>&lt;P&gt;I'm not 100% sure why it didn't, but my best guess is that without the "(txt, codepage is 1252, no labels, delimiter is '\t', msq);" parameters for reading the file it may not have been able to collect the data correctly so no value was returned. not sure why it would work on some and not others. I was able to get it working by adding the parameters:&lt;/P&gt;&lt;P&gt;from '$(File)' (txt, codepage is 1252, no labels, delimiter is '\t', msq);&lt;/P&gt;&lt;P&gt;I also noticed that your orig code will loop through any sub-folders in your root while the code i provided is for a specific folder.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 11:49:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-file-names-from-a-single-directory/m-p/1601345#M444313</guid>
      <dc:creator>olivetwist</dc:creator>
      <dc:date>2019-07-11T11:49:48Z</dc:date>
    </item>
  </channel>
</rss>

