<?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: search for filenames in a directory within a macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/search-for-filenames-in-a-directory-within-a-macro/m-p/473120#M176694</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Micheal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is exactly what I want to have&lt;/P&gt;&lt;P&gt;works perfectly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;Bumin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jan 2013 08:55:07 GMT</pubDate>
    <dc:creator>bumin</dc:creator>
    <dc:date>2013-01-02T08:55:07Z</dc:date>
    <item>
      <title>search for filenames in a directory within a macro</title>
      <link>https://community.qlik.com/t5/QlikView/search-for-filenames-in-a-directory-within-a-macro/m-p/473118#M176692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi together,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anyone help with this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a macro to find the names of the&amp;nbsp; files (regarding a pattern) in a directory&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each file I find I want add the name to my result &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I find the files alpha, beta&amp;nbsp; and charly I will have as result "Dir\alpha;beta;charly"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the Qlikview don't accept the the command " FOR EACH File in FileList(sDir&amp;amp;sSearchPattern)" saying type mismatch&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is my macro&lt;/P&gt;&lt;P&gt;-------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub vInvoice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sDir = "D:\Data\Kunden\ProServ\WW\Project\Qlikview\DMS\"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sFile = sDir&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sSearchPattern = "0101REGM-HV000000001886*.jpg"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox (sDir)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox (sSearchPattern)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FOR EACH File in FileList(sDir&amp;amp;sSearchPattern)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox(File)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sFile = sFile &amp;amp; ";" &amp;amp; File&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NEXT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jan 2013 21:25:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/search-for-filenames-in-a-directory-within-a-macro/m-p/473118#M176692</guid>
      <dc:creator>bumin</dc:creator>
      <dc:date>2013-01-01T21:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: search for filenames in a directory within a macro</title>
      <link>https://community.qlik.com/t5/QlikView/search-for-filenames-in-a-directory-within-a-macro/m-p/473119#M176693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Macro's use VBScript language, not the Qlikview Load Script language so the FOR EACH file .. function won't work as it only works withing QV Load Script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Equivalent function for VBScript would use the filescriptingobject to search a directory.&amp;nbsp; You also lose some functionality in the searchpattern in this area as doesn't have a nice wildcard search by default.&amp;nbsp; If you google vbscript plenty of examples of how to use, an example would be:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub test1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sdir = "D:\......\&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sFile = sDir&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; srchLeft = "0101"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; srchRight = ".jpg"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set fso = CreateObject("Scripting.FileSystemObject")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set fldr = fso.GetFolder(sDir)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set files = fldr.Files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each file in files&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tFile = file.Name&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if left(tFile,len(srchLeft))= srchLeft AND right(tfile,len(srchRight)) = srchRight then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sFile = sFile &amp;amp; ";" &amp;amp; tFile&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end if&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; next&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox(sFile)&lt;BR /&gt;&lt;BR /&gt;End Sub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 04:05:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/search-for-filenames-in-a-directory-within-a-macro/m-p/473119#M176693</guid>
      <dc:creator>michael_anthony</dc:creator>
      <dc:date>2013-01-02T04:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: search for filenames in a directory within a macro</title>
      <link>https://community.qlik.com/t5/QlikView/search-for-filenames-in-a-directory-within-a-macro/m-p/473120#M176694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Micheal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is exactly what I want to have&lt;/P&gt;&lt;P&gt;works perfectly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;Bumin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 08:55:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/search-for-filenames-in-a-directory-within-a-macro/m-p/473120#M176694</guid>
      <dc:creator>bumin</dc:creator>
      <dc:date>2013-01-02T08:55:07Z</dc:date>
    </item>
  </channel>
</rss>

