<?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: Looping through Subfolders and Files in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Looping-through-Subfolders-and-Files/m-p/1662818#M595124</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Attached is a proposal: the objective is&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;make a table of all files in the subfolders of a directory, but only if they are in a certain named folder (Example : "Templates")&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sans titre.png" style="width: 981px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/26386i729191A4DD17813B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sans titre.png" alt="Sans titre.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sub DoDir (Root)



      for each File in filelist (Root&amp;amp;'\*' &amp;amp;Ext)
       let vmatch = wildmatch('$(File)','*Templates*');
       if '$(vmatch)'&amp;gt;0 then
         LOAD 
            '$(File)' as Name, 
            FileSize( '$(File)' ) as Size, 
            FileTime( '$(File)' ) as FileTime
         autogenerate 1;
	   end if
      next File


   for each Dir in dirlist (Root&amp;amp;'\*' )

      call DoDir (Dir)

   next Dir

end sub

Call DoDir('.\test\') ;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jan 2020 09:09:46 GMT</pubDate>
    <dc:creator>Taoufiq_Zarra</dc:creator>
    <dc:date>2020-01-06T09:09:46Z</dc:date>
    <item>
      <title>Looping through Subfolders and Files</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-Subfolders-and-Files/m-p/1662780#M595123</link>
      <description>&lt;P&gt;I was hoping to make a table of all files in the subfolders of a directory, but only if they are in a certain named folder.&lt;/P&gt;&lt;P&gt;As an example I need all excel files that are in a subfolder with a name of 'Templates'.&amp;nbsp; I can't quite grasp my head around the loops in the typically file list script to know if I could just write some sort of expression string as the extension (See below).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sub DoDir (Root)
   for each Ext in '\Templates\*.xlsx'

      for each File in filelist (Root&amp;amp;'\*' &amp;amp;Ext)

         LOAD 
            '$(File)' as Name, 
            FileSize( '$(File)' ) as Size, 
            FileTime( '$(File)' ) as FileTime
         autogenerate 1;

      next File

   next Ext
   for each Dir in dirlist (Root&amp;amp;'\*' )

      call DoDir (Dir)

   next Dir

end sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In theory I could make a list of all files, but that will be quite a long list and was hoping I could tell it only to look in subfolders called 'Templates'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 08:22:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-Subfolders-and-Files/m-p/1662780#M595123</guid>
      <dc:creator>Jagsfan82</dc:creator>
      <dc:date>2020-01-06T08:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through Subfolders and Files</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-Subfolders-and-Files/m-p/1662818#M595124</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Attached is a proposal: the objective is&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;make a table of all files in the subfolders of a directory, but only if they are in a certain named folder (Example : "Templates")&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sans titre.png" style="width: 981px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/26386i729191A4DD17813B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sans titre.png" alt="Sans titre.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sub DoDir (Root)



      for each File in filelist (Root&amp;amp;'\*' &amp;amp;Ext)
       let vmatch = wildmatch('$(File)','*Templates*');
       if '$(vmatch)'&amp;gt;0 then
         LOAD 
            '$(File)' as Name, 
            FileSize( '$(File)' ) as Size, 
            FileTime( '$(File)' ) as FileTime
         autogenerate 1;
	   end if
      next File


   for each Dir in dirlist (Root&amp;amp;'\*' )

      call DoDir (Dir)

   next Dir

end sub

Call DoDir('.\test\') ;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 09:09:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-Subfolders-and-Files/m-p/1662818#M595124</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-01-06T09:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through Subfolders and Files</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-Subfolders-and-Files/m-p/1662875#M595125</link>
      <description>&lt;P&gt;Thanks for the suggestion.&amp;nbsp; I definitely think that will work and actually gives me other ideas.&amp;nbsp; I was hoping the wildcard search could be used in a way to speed up the search though.&amp;nbsp; I'll try to give it a test to make sure since I want the Templates to be in the folder directory, but that shouldn't matter based on your solution.&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&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;&amp;nbsp;&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;&amp;nbsp;&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;&amp;nbsp;&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;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 12:17:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-Subfolders-and-Files/m-p/1662875#M595125</guid>
      <dc:creator>Jagsfan82</dc:creator>
      <dc:date>2020-01-06T12:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through Subfolders and Files</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-Subfolders-and-Files/m-p/1662879#M595126</link>
      <description>&lt;P&gt;Ok&lt;/P&gt;&lt;P&gt;waiting for your feedback !&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 12:21:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-Subfolders-and-Files/m-p/1662879#M595126</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-01-06T12:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through Subfolders and Files</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-Subfolders-and-Files/m-p/1663018#M595127</link>
      <description>&lt;P&gt;Have a look at the following Design Blog post as there is a pretty related example there:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Loops-in-the-Script/ba-p/1473543" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Loops-in-the-Script/ba-p/1473543&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If you wish to further search this area, use the following base URL:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Be sure to return once you get something working and either use the Accept as Solution button on an existing post or if you did something different, write that up and then use the button on it after you post it, this way the other Community Members know what actually worked and if you do one of the other posts, that gives credit to them...&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 16:29:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-Subfolders-and-Files/m-p/1663018#M595127</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2020-01-06T16:29:59Z</dc:date>
    </item>
  </channel>
</rss>

