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

How to export a table to a text file without extra quotes

I have a table that has a single text field in it. When I export it to a csv file in a version 10 script, for example

store mytable into myfile.txt (txt)

QlikView wraps double quotes around the lines in myfile.txt if there are spaces in the line. Also, if there is a " in the text itself QlikView adds another " next to it.

I would like for the exported text file to not contain the added quotes. I can certainly post-process the text file but I would prefer not to. Does anyone have a solution for this?

Thanks,

Barry

24 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

It's obviously going in there as a delimiter.  My guess is you need to change this line:

obj.Export pth.getcontent.string&"Export.txt", 1


Perhaps to:


obj.Export pth.getcontent.string&"Export.txt", ","


Good luck.

lalitinmbd
Partner - Contributor III
Partner - Contributor III

Dear Steve,

Thanks for your response. It worked. But now a new problem has arrived. The code is returing the below output.

If the Company is """"Samsung"""" it is giving the "Samsung  " as result. The result should be "Samsung". It is replacing the first occurance of "". Any idea how to solve this.

Thanks

Lalit

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Lalit,

It looks like you have a few different permutations of Samsung in your source data.  I'm not sure what the chr(0) would be doing there, personally I would probably go for this instead:


strNewText = ""


Without taking the time to recreate with your source data it's hard to work out exactly what is going on.


- Steve



woutermak
Partner - Creator III
Partner - Creator III

The no quotes option is also great to load Excel with quotes.
(txt, codepage is 1252, no labels, delimiter is '\t', no quotes)
Thanks

dxperez8
Contributor
Contributor

Was the bug ID  69149 fixed?