CSVfox
Leverage Your Data.
 English

±quotechar, ±q

Defining which text quotation character is used in the CSV file

Description

Quoting a text field in CSV means enclosing it with quotation characters.
Nearly always the quotation character is the " (double-quote), which is understood by most CSV readers and import programs. So this should not be changed if that can be avoided.

Generally, in CSV files simple data fields containing just a word or a number do not need to be quoted, they are just separated by the delimiter character. But as soon as the data field contains text with white space, line breaks or the delimiter character itself, it has to be enclosed between quotation characters to make this clear.
The quotation character you can configure here is the one that used for this.

Pattern

±q=character ±quotechar=character

Depending on the operating system and the command line or shell, it may be difficult to enter a single or double quote character directly.
For denoting the desired quote char, you can therefore also denote the single-quote ' as "single", as "single-quote" or as "singlequote".
The double-quote " can accordingly be denoted as "double", "double-quote", or as "doublequote".
If you want to omit quoting completely, use the value "none".
(There are a lot of other names for special or control characters, the full list is still to be documented.)

Usage Examples

csvfox infile.csv +q='
Assumes that the CSV file to read has single-quotes as quotation characters.
csvfox infile.csv +q=double
Assumes that the CSV file to read has double-quotes as quotation characters.
csvfox infile.csv -q=pipe outfile.csv
Reads infile.csv (with default quotation character) and writes it into outfile.csv, using a pipe ("|") character as quotation character for writing. (OK, that's just an example.)

Technical Hint

The default quotation character is ".
Inside the data field, if a quotation character is needed, this character will be doubled. So a " inside a quoted text field will be represented as "" in a raw CSV file. This conforms to CSV rules and is inteded. No required manual action here, as this conversion will be handled automatically.
Under construction, coming soon