Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

Why does Qlik adds quotes to a string when storing table to txt file

I have a table with one field.

One record contains a string:

first part is:  <iframe src="data&colon;application/pdf;base64,JVBERi0xLjY   

then a lot of characters 

last part =  QolJUVPRg0K",height="200%" width="100%" </iframe>

note that there are no quotes around this string, so when putting this string in a text box Qlik warns it is garbage 🙂

When I store this table to a txt file  with:  store tablename to filename.html (txt) QLik change this string by adding double quotes. Not only at the beginning and end of the string, but also where the are quotes in the string.

So the output is :

First part: "<iframe src=""data&colon;application/pdf;base64,JVBERi

then a lot of characters

last part UVPRg0K"",height=""200%"" width=""100%"" </iframe>"

 

Please help me to prevent the additional quotes. I tried a lot of options like storing the string to a variable, but nothing helps. I know I started a similar topic before but I really need this.

Labels (2)
3 Replies
marcus_sommer

I think you will always need additionally steps to get your wanted results because the reason for this behaviour are the - probably quite old windows - libraries for the txt-storing/export which have not really customizable options how quotes should be handled.

This means you need to adjust the output after the storing or adjusting the target-system to be capable to process the data like they are or you may switch from a complete storing/export approach and writing the data cell for cell within a macro-loop in the UI. Here you will find some more backgrounds and an example how it might be done:

Solved: Export to CSV with quotation marks - Qlik Community - 1138389

In general it should be also possible to trigger a macro write-logic on a record-level from the script to avoid the UI detour. But until today I didn't need it and have therefore no example for it.

- Marcus

marco_lapolla
Contributor
Contributor

Have you tried to replace the "" with replace (text_field, '"', '') ?

curiousfellow
Specialist
Specialist
Author

Qlik adds the quotes when storing to the text file. So they are not in the
record or in the variable, which I tried to use too. Besides that the
original quotes have to remain in the string.