<?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: How to skip script if directory is empty in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1855772#M70632</link>
    <description>&lt;P&gt;Thank you! This works a treat!&lt;/P&gt;</description>
    <pubDate>Thu, 04 Nov 2021 21:03:12 GMT</pubDate>
    <dc:creator>Fred-Zabala</dc:creator>
    <dc:date>2021-11-04T21:03:12Z</dc:date>
    <item>
      <title>How to skip script if directory is empty</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1855346#M70595</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am currently scanning a directory for certain files. How do i skip the rest of the script if it doesn't find any of the following files? Please see below for script. So if it cannot find anything in the (Lease File List), i want it to ignore the call for Documentlist_leases and skip to //SubFileLIst&lt;/P&gt;
&lt;P&gt;// Lease file list&lt;BR /&gt;sub DoDir (Root)&lt;BR /&gt;for each Ext in 'txt', 'xlsx', 'docx', 'pdf', 'msg'&lt;/P&gt;
&lt;P&gt;for each File in filelist (Root&amp;amp;'\*.' &amp;amp;Ext)&lt;/P&gt;
&lt;P&gt;DocumentsList_Leases:&lt;BR /&gt;LOAD&lt;BR /&gt;'$(File)' as LeasefullPath, &lt;BR /&gt;SubField('$(File)', '\', 6) as PML_SEQ, //return everything after the 5th '\'&lt;BR /&gt;Right( '$(File)', Len( '$(File)') - FindOneOf( '$(File)', '\', 6) ) as LeaseFileName&lt;BR /&gt;autogenerate 1; &lt;BR /&gt;&lt;BR /&gt;next File &lt;BR /&gt;&lt;BR /&gt;next Ext&lt;BR /&gt;&lt;BR /&gt;for each Dir in dirlist (Root&amp;amp;'\*' )&lt;BR /&gt;call DoDir (Dir) &lt;BR /&gt;next Dir &lt;BR /&gt;&lt;BR /&gt;end sub&lt;/P&gt;
&lt;P&gt;call DoDir ('\\AKL-SQL01.anz.corp.local\IIS_$(vClient)\F_Pm_Lease\')&lt;BR /&gt;Call StoreAndDrop('DocumentsList_Leases');&lt;/P&gt;
&lt;P&gt;//Sublease file list&lt;BR /&gt;sub DoDir (Root)&lt;BR /&gt;for each Ext in 'txt', 'xlsx', 'docx', 'pdf' &lt;BR /&gt;&lt;BR /&gt;for each File in filelist (Root&amp;amp;'\*.' &amp;amp;Ext) &lt;BR /&gt;&lt;BR /&gt;DocumentsList_Subleases: &lt;BR /&gt;LOAD&lt;BR /&gt;'$(File)' as SubleasefullPath, &lt;BR /&gt;SubField('$(File)', '\', 6) as F_Pm_Sublease_SEQ, //return everything after the 5th '\'&lt;BR /&gt;Right( '$(File)', Len( '$(File)') - FindOneOf( '$(File)', '\', 6) ) as SubleaseFileName&lt;BR /&gt;autogenerate 1; &lt;BR /&gt;&lt;BR /&gt;next File &lt;BR /&gt;&lt;BR /&gt;next Ext&lt;BR /&gt;&lt;BR /&gt;for each Dir in dirlist (Root&amp;amp;'\*' )&lt;BR /&gt;call DoDir (Dir) &lt;BR /&gt;next Dir &lt;BR /&gt;&lt;BR /&gt;end sub&lt;/P&gt;
&lt;P&gt;call DoDir ('\\AKL-SQL01.anz.corp.local\IIS_$(vClient)\F_Pm_Sublease\');&lt;BR /&gt;Call StoreAndDrop('DocumentsList_Subleases');&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 03:48:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1855346#M70595</guid>
      <dc:creator>Fred-Zabala</dc:creator>
      <dc:date>2021-11-04T03:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip script if directory is empty</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1855355#M70596</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;If NoOfRows(&lt;SPAN&gt;'DocumentsList_Subleases') &amp;gt; 0 Then&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; Call StoreAndDrop('DocumentsList_Subleases');&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;EndIf&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;-Rob&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 05:30:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1855355#M70596</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2021-11-04T05:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip script if directory is empty</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1855772#M70632</link>
      <description>&lt;P&gt;Thank you! This works a treat!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 21:03:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1855772#M70632</guid>
      <dc:creator>Fred-Zabala</dc:creator>
      <dc:date>2021-11-04T21:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip script if directory is empty</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1856336#M70680</link>
      <description>&lt;P&gt;Hey&lt;/P&gt;
&lt;P&gt;Another question. We've pulled massive files from our network already, and its good to re-run the script every now and then so that it gets the latest files. But is there a way to skip files which we already have pulled into the qvd? LIke a skip for it, and only pull the latest ones?&lt;/P&gt;</description>
      <pubDate>Sun, 07 Nov 2021 20:24:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1856336#M70680</guid>
      <dc:creator>Fred-Zabala</dc:creator>
      <dc:date>2021-11-07T20:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip script if directory is empty</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1856371#M70682</link>
      <description>&lt;P&gt;Just to clarify. You are not actually loading data from those files, you are just building a list of filenames, correct?&lt;/P&gt;
&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 03:20:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1856371#M70682</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2021-11-08T03:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip script if directory is empty</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1856372#M70683</link>
      <description>&lt;P&gt;Yep. Not loading, building a list of filenames.&lt;/P&gt;
&lt;P&gt;Basically, filenames will be put into a table, which will create links to said filename. That's all, pulling data from the files themselves&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 03:23:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1856372#M70683</guid>
      <dc:creator>Fred-Zabala</dc:creator>
      <dc:date>2021-11-08T03:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip script if directory is empty</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1856728#M70712</link>
      <description>&lt;P&gt;I can't think of ways to "skip" files that would be any faster than what you are doing. Unless your directories are by date and you could skip entire directories.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 15:59:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1856728#M70712</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2021-11-08T15:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip script if directory is empty</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1857426#M70772</link>
      <description>&lt;P&gt;Unfortunately, all our files our files are not by dates but by actual document name.&lt;/P&gt;
&lt;P&gt;I'll see if we can do something about the naming, but thanks for the help on the rest &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 02:31:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-skip-script-if-directory-is-empty/m-p/1857426#M70772</guid>
      <dc:creator>Fred-Zabala</dc:creator>
      <dc:date>2021-11-10T02:31:08Z</dc:date>
    </item>
  </channel>
</rss>

