Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to create a '|' separated csv file with each field value within quotes to allow upload to a central database.
My Store command creates the csv file, but the quotes that I have included with each value are written inside additional sets of quotes
For example, if I want to export a field value "ABC", the resultant csv file actually contains """ABC"""
Is there any way to prevent this happening without any further actions after my script has executed? (I don't want to use macros or have to process the file again in VB etc.)
I have tried to include a 'no quotes' parameter to my Store command to no avail
The STORE command I am using is similar to this
STORE MyTable INTO mycsvfile.csv (txt, delimiter is '|');
If all fields contain quotes, you could do:
replace(Field,'"','') as Field
That would remove the quotes from the field.
A workaround could be to create already your table in this way, like:
csvTable:
Load F1 & '|' & F2 & '|' & F3 & '|' & F4 ... as csvField From xyz;
store ...
- Marcus
Only problem is that produces a header line in line 1 reading csvField. One possible workaround
csvTable:
Load F1 & '|' & F2 & '|' & F3 & '|' & F4 ... as [F1|F2|F3|F4] From xyz;
store ...
but I think the F1 and F4 fields will contain the square brackets [F1 and F4]...
Of course, you are right and it might need a combination from double-quotes, square-brakets and grave accents.
- Marcus
... so it looks like this is a well known issue.
I have voted as you suggest, have you any idea if Qlik have indicated any intention to look at this?
Good idea Marcus,
I have tried it but it does not get around the issue unfortunately
It looks as though there is a well known issue, and trawling the community there are a number of similar queries that are unanswered.
There just is not enough control over the output when using the STORE command, QlikView will encapsulate quotes within another set of quotes wherever it finds them.
I'm not sure if you really needs quotes if you used '|' as delimiter - or maybe another unique char which is very unlikely to be within the data (such a other unique char could be also used as a quotes-replacing which in a further processing could be reversed)
- Marcus
Unfortunately I do need to include quotes as it is the specification for files that will be imported into a central database.
If I find any work around I will update the thread
Thanks