Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I want to generate command line list to use in a bat file in.
I defined 5 variables with SET for the fixed text parts of my command line. these will be combined with a variable, created from a list and called one by one with a peek.
I get double quotes in my results when I do not need them.
If I call variable 1: set part1 = 'C:\Program Files (x86)\Advanced XML Converter\exporter.exe';
as '$(part1)' as ....
and store BatFile to BatFile.bat (txt);
I get this result: C:\Program Files (x86)\Advanced XML Converter\exporter.exe
Should be: "C:\Program Files (x86)\Advanced XML Converter\exporter.exe"
If I change part 1 to set part1 = '"C:\Program Files (x86)\Advanced XML Converter\exporter.exe"';
I get this: """C:\Program Files (x86)\Advanced XML Converter\exporter.exe"""
I need to get rid off these extra "".
The table BatFile.bat is generated with Autogenerate(1) for each line.
How to get rid off the extra double quotes?
MichielvandeGoor : Enclose your whole command in another pair of quotes :
EXECUTE CMD.exe /C ""C:\Program Files (x86)\Advanced XML Converter\exporter.exe" Parameter1 Parameter 2"; |
use Chr(39) instead of "
Chr(39) & 'C:\Program Files (x86)\Advanced XML Converter\exporter.exe' & Chr(39)
Sorry! Chr(34) is double quotes
Hi,
I would try changing SET to LET in the script.
Hope that helps
LET instead of SET doesn't make a difference
I tried this allready. Thanks anyway.
Hi,
You need to use the original part1, add the additional double quotes around it, and combine with the & symbol to build your query such as
Let vDosCMD=' " ' & 'C:\Program Files (x86)\Advanced XML Converter\exporter.exe' & ' " ' & other strings here
You can then use the EXECUTE $(vDosCMD) or similar to run the command.
This way you can pass parameters to your dos command etc as needed.
Peter,
In QlikView the result looks ok but in the export .bat (txt) file is get the same result as previous tries:
" ""C:\Program Files (x86)\Advanced XML Converter\exporter.exe"" "
Let vDosCMD=' "' & 'C:\Program Files (x86)\Advanced XML Converter\exporter.exe' & '" ';// & other strings here
BatFile:
load
'$(vDosCMD)' as [@echo off]
AutoGenerate (1);
store BatFile into C:\Lokale bestanden\Customer\xml_to_csv\BatFile.bat (txt);
I used your suggestion and created a table build out of all components for the content of the bat file.For test I exported the table as text to notepad, saved as .bat and started if from the command line.
The content works as needed.
Now automate the export with a macro and add the .bat to the Supporting tasks in Publisher.
Thanks all!
Export to file or store brings the double quotes right back.
A manual export from the table doesn't but that is a show stopper.