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
Hi,
See the below example, I used chr(34):
And here is the data model:
Hope this helps.
When I used the chr(34) to surround the date field, it produced this format in my CSV which isn't what I wanted:
"""7/6/2011 12:00:00 AM"""
I only want to surround the data value with double quotes. How can I fix this?
Thanks for the help!
Can you post a sample data-set here? Because you shouldn't be having this issue unless there are already double quotes in this field?
Here's a screenshot of the first two columns in my QVD file.
As you can see, there are no quotes. I can produce a CSV as the way it is. I just needed to surround each
column with the double quotes. Thanks
Here are the two lines of code in my load statement which produces the output shown in the screenshot.
chr(34) & Timestamp(TransactionPostDate) & chr(34) as 'TransactionPostDate2',
Date(TransactionPostDate) as 'TransactionPostDate',
Even when I tried this, I got six double quotes. Is there some type of global setting that I need to look at?
LOAD
chr(34) & 'Test' & chr(34) as 'Col1'
"""Test"""
"""Test"""
Another question is how does your store function look like to export to csv?
I have been using the below and never had this problem:
Store Test into 'C:/Desktop/Text.csv'(txt);
Probably. I think the best way to find out is looking at you app so if you could attach your qvw, it would be better.
I think your text delimiter is "" ie "Test" in the source file so you may need to change that in the load script if you are loading the data from a csv or excel.