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

How to add double quotes

Hello,

I know how to read a QVD and export it to a CSV.  But how would I go about adding double quotes to my

field data?  For example, say my QVD contains 3 columns.  First name, last name and street.  I want the content of

my CSV file to look like this:

"JOHN", "DOE", "123 ABC STREET"

Thank you

28 Replies
Anonymous
Not applicable
Author

This did not work either.  It produced this:

mystring

"""john"",""doe"",""123 abc street"""

Rob and Jonathan already pointed out that this seems to be "impossible" in QV.

Anonymous
Not applicable
Author

Jonathan,

How would you go about using GnuWin32 tool?  Is this some type of batch/background tool where you just

specify the command line and switches and it will insert the double quotes around each data value by parsing out

the coma as the delimiter for each row/line in the TXT/CSV file?

anlonghi2
Creator II
Creator II

I checked the result using excel and...it is ok now, but if you open it with notepad the result is wrong again...

Anonymous
Not applicable
Author

Hi anlonghi2,

I appreciate your help here. 

Yes, if you open it in Excel, it looks fine.  Even with all the samples I posted with those extra quotes, they will look

fine in Excel.  This is a feature of Excel which it knows how to render it when it sees a CSV.  However I need my result to be correct when viewed in NotePad and NOT in Excel.

anlonghi2
Creator II
Creator II

with a tricky I obtained the following result, where you can consider single quota as field separator...

"SGD"'"26/07/2014"'"'"12"'

"JPY"'"26/07/2014"'"'"12"'

"ZAR"'"26/07/2014"'"'"12"'

"NOK"'"26/07/2014"'"'"12"'

"SEK"'"26/07/2014"'"'"12"'

"NOK"'"26/07/2014"'"'"12"'

"ZAR"'"26/07/2014"'"'"12"'

"SEK"'"26/07/2014"'"'"12"'

"ZAR"'"26/07/2014"'"'"12"'

"USD"'"30/08/2014"'"'"12"'

"USD"'"30/08/2014"'"'"12"'

Anonymous
Not applicable
Author

There's an extra quote after the year and before the 12 on the Singapore Dollar line


"SGD"'"26/07/2014"'"'"12"'


If you can fix this, that might work for me.   Thanks




anlonghi2
Creator II
Creator II

Sidneylu,

look at attached qvw and to its output (the result starts and ends with a single quota but is the best result I got...)

Best regards

Andrea

Anonymous
Not applicable
Author

Hi anlonghi2

Yes, I can see your result starts and ends with a single quote.  I think I can tweak your app to remove

the first and last character of the content.  Maybe this content needs to be stored in a temp area; then use

substring function to strip out first and last character or include what we need.  If this was written in .NET

or TSQL, it's a very SIMPLE thing to do.  But I need to figure out how to put this in QV language. 

Will post once I figure it out....

Thanks

anlonghi2
Creator II
Creator II

Hi Sidneylu,

I modified the qvw so now it stores each record between a single quota.

I hope it can help you.

Best regards

Andrea