Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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?
I checked the result using excel and...it is ok now, but if you open it with notepad the result is wrong again...
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.
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"'
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
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
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
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