<?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: Writing .bat file in script? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812300#M471682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks its working but What i exactly needed is, I have a Folder Name called Testsource in that i have lots of excel files.&lt;/P&gt;&lt;P&gt;I need to create a new folder and need to move or copy some of the file in that.&lt;/P&gt;&lt;P&gt;For Example,&lt;/P&gt;&lt;P&gt;I have Excel files starting in alphabet A to E, so i need to move or copy those file alone in a new folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible in Qlikview.. If its possible can you guide me how to solve in this using Condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Vignesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Mar 2015 13:53:13 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-03-02T13:53:13Z</dc:date>
    <item>
      <title>Writing .bat file in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812298#M471680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a scenario Where i have excel file in a source directory&lt;/P&gt;&lt;P&gt;I need to check the File name in alphabetical order and need to separate the files and move or copy into certain folders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;File like&lt;/P&gt;&lt;P&gt;Example&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; A.xlsx,&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; B.Xlsx&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; C.XLSX and so on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to generate the QVD to do this process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do Have sample script,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BatFile:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Move E:\Testsource\*.xlsx E:\TestDestination\' As [@echo off]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Execute E:\Automove.bat;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its moving the entire file to the destination folder. Kindly give me some idea or guidance to solve it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;Vignesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 13:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812298#M471680</guid>
      <dc:creator />
      <dc:date>2015-03-02T13:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Writing .bat file in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812299#M471681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vignesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way i like todo this is to make a string of your DOS command, and then tell QlikView to execute the command, such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vDosCommand = 'CMD /s /c "Move E:\Testsource\*.xlsx E:\TestDestination\"';&lt;/P&gt;&lt;P&gt;EXECUTE $(vDosCommand);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dos commands are online if you google them, but the CMD is command prompt&lt;/P&gt;&lt;P&gt;/s is silent mode&lt;/P&gt;&lt;P&gt;/c is close after execute&lt;/P&gt;&lt;P&gt;anything within the double quotes " " is the actual command.&lt;/P&gt;&lt;P&gt;You can also string multiple dos commands together by adding the &amp;amp;&amp;amp; to the end followed by another dos command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll also need to set QlikView to 'Can Execute External Programs' in the settings of the edit script window.&lt;/P&gt;&lt;P&gt;One thing to note is that QlikView does not get a message back from this command prompt saying if the command worked ok, but you can check this from the logs if needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 13:28:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812299#M471681</guid>
      <dc:creator>peter_turner</dc:creator>
      <dc:date>2015-03-02T13:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Writing .bat file in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812300#M471682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks its working but What i exactly needed is, I have a Folder Name called Testsource in that i have lots of excel files.&lt;/P&gt;&lt;P&gt;I need to create a new folder and need to move or copy some of the file in that.&lt;/P&gt;&lt;P&gt;For Example,&lt;/P&gt;&lt;P&gt;I have Excel files starting in alphabet A to E, so i need to move or copy those file alone in a new folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible in Qlikview.. If its possible can you guide me how to solve in this using Condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Vignesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 13:53:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812300#M471682</guid>
      <dc:creator />
      <dc:date>2015-03-02T13:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Writing .bat file in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812301#M471683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create an INLINE table with source specifications (e.g. A*.xlsx, B*.xlsx etc.) in the first column and target (sub)directories in the second column. This is what you will be editing whenever some files should go somewhere else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then create a loop around Peter's execute statement, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FromToSpecs:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;From, To&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;A*.XLSX, Directory1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;B*.XLSX, Directory1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;E*.XLSX, Directory1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;F*.XLSX, Directory2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FOR i = 0 TO NoOfRows('FromToSpecs') - 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; LET vFromFileMask = 'E:\&lt;SPAN style="color: #3d3d3d; font-size: 13px;"&gt;Testsource\' &amp;amp; peek('From', $(i), 'FromToSpecs');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; LET vDestination = 'E:\TestDestination\' &amp;amp; peek('To', $(i), 'FromToSpecs') &amp;amp; '\';&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;&amp;nbsp; EXECUTE CMD.EXE /c /s COPY "$(vFromFileMask)" "$(vDestination)";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;NEXT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;If you want to move the files over, use MOVE instead of COPY.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 14:52:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812301#M471683</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-03-02T14:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Writing .bat file in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812302#M471684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Peter'C example will give you more flexibility and would be the best to use here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying to find if you can run a dos command such as dir [a-e]*.xlsx but it doesn't appear you can.&lt;/P&gt;&lt;P&gt;Else just a long string such as &lt;/P&gt;&lt;P&gt;Let vDosCommand = 'CMD /s /c &lt;/P&gt;&lt;P&gt;"Move E:\Testsource\A*.xlsx E:\TestDestination\" &amp;amp;&amp;amp;&lt;/P&gt;&lt;P&gt;"Move E:\Testsource\B*.xlsx E:\TestDestination\" &amp;amp;&amp;amp;&lt;/P&gt;&lt;P&gt;"Move E:\Testsource\C*.xlsx E:\TestDestination\" &amp;amp;&amp;amp;&lt;/P&gt;&lt;P&gt;"Move E:\Testsource\D*.xlsx E:\TestDestination\" &amp;amp;&amp;amp;&lt;/P&gt;&lt;P&gt;"Move E:\Testsource\E*.xlsx E:\TestDestination\" ;&lt;/P&gt;&lt;P&gt;This should work but i'd go for Peter'C example instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 15:11:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812302#M471684</guid>
      <dc:creator>peter_turner</dc:creator>
      <dc:date>2015-03-02T15:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Writing .bat file in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812303#M471685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In DOS times, regular expressions were Unix-only territory. Unfortunately...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 15:18:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Writing-bat-file-in-script/m-p/812303#M471685</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-03-02T15:18:21Z</dc:date>
    </item>
  </channel>
</rss>

