Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Store in CSV without double quotes

Hi,

I have a script which ends by storing formated data in a csv file (delimiter ';') that can later be uploaded in SAP. This is for a recurring job I'd like to get fully automated. It all works fine except that the final csv file contains double quotes around a field. This field is a long text containing a simple quote, which I insert as &chr(39)& in the concatenation.

But then, whether I make

store * from ExportCSV into ExportCSV.csv (txt, utf8, delimiter is ';')

or

store * from ExportCSV into ExportCSV.csv (txt, utf8, delimiter is ';', no quotes)

I get those double quotes.

Is there a way to overcome this? Or is there other ways, like using a macro to clear the double quotes in the csv afterwards ?

Many thanks in advance.

16 Replies
giakoum
Partner - Master II
Partner - Master II

I tried it and it works correctly for me (see attached)

or maybe I misunderstood...

Not applicable
Author

After more tests, it turned out it's due to a simple quote in this field. I edited original post.

But that's the way this field should be, and without the double quotes when I store it. Is there a trick to deal with this?

srchilukoori
Specialist
Specialist

This seems to work for me, can you upload a sample set of data to test it.

Thanks,

SC

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hi, I tested Ioannis Giakoumakis example and it works, however, your issue could be with something else, could you upload a sample of your data please?

regards

Not applicable
Author

Thanks for your answers. Problem appears exactly when I add a text field containing a simple quote, example in attached.

srchilukoori
Specialist
Specialist

Single and double quotes are part of Qlikview's reserve literals to identify strings. That is the reason why it adds double quotes to your csv file.

Not applicable
Author

OK. Is there any way to get the csv rid of double quotes automatically after this?

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

maybe using purgechar() before exporting to csv

Not applicable
Author

This field is meant to be transmitted to SAP in the end with the simple quote. Is there a way through a QV macro to either clean the csv or add the quote in csv afterwards?