Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Michiel_QV_Fan
Specialist
Specialist

Double quotes and store to

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?

1 Solution

Accepted Solutions
gardenierbi
Creator II
Creator II

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";

View solution in original post

11 Replies
giakoum
Partner - Master II
Partner - Master II

use Chr(39) instead of "

Chr(39) & 'C:\Program Files (x86)\Advanced XML Converter\exporter.exe' & Chr(39)

giakoum
Partner - Master II
Partner - Master II

Sorry! Chr(34) is double quotes

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

I would try changing SET to LET in the script.

Hope that helps

Michiel_QV_Fan
Specialist
Specialist
Author

LET instead of SET doesn't make a difference

Michiel_QV_Fan
Specialist
Specialist
Author

I tried this allready. Thanks anyway.

peter_turner
Partner - Specialist
Partner - Specialist

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.

Michiel_QV_Fan
Specialist
Specialist
Author

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);

Michiel_QV_Fan
Specialist
Specialist
Author

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!

Michiel_QV_Fan
Specialist
Specialist
Author

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.