CSVfox
Leverage Your Data.
 English

±escapechar

Defining how to mark quotation characters inside a quoted field

Description

The escape character can be used when a quote character is inside a CSV field that itself is quoted using this character. E.g., the doublequote character " is used as qutotation character, and at the same time it occurs in the data field.

There are three ways to solve this problem:
- each embedded quote character " will automatically be doubled to "" . This is the most common approach in CSV files, and it is the default value. Nothing to do here.
- sometimes an escape character is used for marking the subsequent quote character as being embedded, i.e. to escaping the " to e.g. \" . This \ is the escape character that can be configured here.
- or a different quotation character for field quoting can be chosen, e.g. a single-quote ' (if this character will not occur in the field). You can configure a different quotation character via ±quotechar, ±q.

Before configuring anything here, please make sure that the other table-generating or consuming application will also support this.

Pattern

±escapechar=character

For denoting the most usual escape char, you can denote the back-slash \ as "backslash", or as "back" for short.
(There are a lot of other names for special or control characters, the full list is still to be documented.)

If you want to have default behavior, you can use the value "none" (but this is not necessary). This means that quote characters are being doubled when they are inside quoted text fields.

Usage Examples

csvfox infile.csv +escapechar=backslash
Assumes that the CSV file to read uses the backslash character for marking of embedded quotation characters.
csvfox infile.csv +escapechar=none
Assumes that the CSV file to read uses doubling of quotation characters in order to mark that this character is literal, i.e. embedded. (This is standard behavior and configuring it is not necessary.).
csvfox infile.csv -escapechar=pipe outfile.csv
Reads infile.csv (with default doubled quotation character inside fields) and writes it into outfile.csv, using a pipe ("|") character as escape character the quotation character when writing. (OK, that's just an example.)

Technical Hint

The default behavior is doubling the " to "".
No required manual action here, as this conversion will be handled automatically.
 
Under construction, coming soon