Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

qlikhalmar
Contributor

Extra double quotes when store as TXT

Hi,

I have a problem when store a string as txt.

I have a variable with XML content inside. When I store this, via a table, to txt, QlikView add after every double quote an extra double quote. That makes that my generated file not usefull anymore. And at the begin and the end QlikView add also a double quote.

Attached my simpel example.

Thanks, Halmar

5 Replies
giakoum
Honored Contributor II

Re: Extra double quotes when store as TXT

replace double quotes with Chr(34)

LET vXML =

'<?xml version=' & chr(34) & '1......

giakoum
Honored Contributor II

Re: Extra double quotes when store as TXT

better solution

remove txt :

STORE Test INTO [Test.xml];

Re: Extra double quotes when store as TXT

Due to the text format conversion for the space its adding the "" with it...

store directly as .xml without (txt)

MVP
MVP

Re: Extra double quotes when store as TXT

STORE .... (txt) stores a comma separated file with normal quoting rules (msq). Because the file only contains a single 'field', and this field contains commas and quotes, the field is quoted (double quotes at the start and end), and doubling up internal double quotes to 'escape' them.

You can change the delimiter, but I don't think you can change the quoting rules to no quotes. XML will accept single quotes, so you could try using single quotes like:

LET vXML = '<?xml version=''1.0'' encoding=''utf-8'' ?>' & CHR(10) & '

  <configuration>' & CHR(10) & '

  <configSections>' & CHR(10) & '

  <sectionGroup name=''applicationSettings'' .....

Note that ''1'' is a 1 surrounded with two single quotes on each side to escape the single quote and is less complicated than embedding chr(x) statements.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
qlikhalmar
Contributor

Re: Extra double quotes when store as TXT

Hi Ioannis,

Thanks for your response.

This is not working because QlikView now adds the XML-header to the generated XML.

The trick with chr(34) is also not working since the extra quotes are added during the store statement.

Community Browser