Export Results -> CSV creates with the "wrong" Seperator

TenGor

Member³
Hy,

if i export my Select to a CSV-File i get the following:
----------
"ID","TXT","TXT2"
"1","aaa","j"
"2","bbb","n"
----------
Shouldn't there be ';' as a Seperator?
The Default in Excel is it (german Version?)
Would be nice to set a preference for this.

Another point: Why is every field enanced with "?
Well, if i import the file in Excel, there is no Problem, but if i use the file for a Import via SQL*Plus i had to change my control-file.
An Option for this would be nice too.

Thanks in advance
 
CSV files can be a real pain. CSV stands for Comma Separated Value so normally a comma is used. Excel (US) uses a comma but I guess the German version is different.

The " is used in case a , (or ; for you) is in the string, like this:

"a","b,c","d" -- Good, 3 fields
a,b,c,d -- Bad, 4 fields

If you want to have a " in the field then you need to escape it with another ":

"a","""b,c""","d" -- The fields are a and "b,c" and d

This is the same as ' in a PL/SQL string. Some tools do not handle this correctly when exporting CSV files.

Sometimes it is easier to use T (Tab) SV files if you are dealing with text. They may be less likely to have tabs than " (such as URLs).

Lastly, hope you don't ever have to deal with CSV files that Carriage Returns in fields. This can occur when you are trying load data from an email or form on a web page. I had to write a pre and post processor to correctly handle them.

Bruce
 
Hello,

A semicolon is used instead of comma when a conflict with national settings is discovered. In Poland for example a comma is a decimal point separator in numbers.

Joachim Rupik
 
Hy,

@BruceB
It's correct, i used the German Version.
So it seems ok that PL/SQL use a Comma...
But it would very nice if i can customize this.

> The " is used in case a , (or ; for you) is in the string.

For a string, it's ok for me, but i've selected numbers too, and there are " too??
 
Back
Top