on 2016 Nov 03 12:09 PM
I am using ISQL with SQL Anywhere 8 to export some data from tables to csv. My query looks something like this:
SELECT ColumnA, ColumnB, ColumnC FROM sometable WHERE ....; OUTPUT TO 'c:\\file.csv' FORMAT ASCII QUOTE '';
When there is a comma in the value of any of the columns, it causes the data to get truncated and shift. For example, if ColumnA has the text 'some text, more text' then ColumnA in the resulting spreadsheet will be 'some text' while ColumnB will be 'more text'. This is messing up the formatting. I've tried using different delimiters with no luck. The goal here is to get the csv data into a nicely formatted Excel spreadsheet.
Thanks, Tom
Request clarification before answering.
Hi Tom, that's what the quotes are for. If the separator character appears within the quotes, it will be considered part of the string value. When importing the .csv into Excel, you can also specify the quote, causing Excel to remove them from the actual value.
It is the fundamental issue with csv that without quotes, you need a separator character (or sequence) that can't occur in values.
HTH
Volker
DB-TecKnowledgy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
30 | |
8 | |
8 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.