±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
There are three ways to solve this problem:
- each embedded quote character
- sometimes an escape character is used for marking the subsequent quote character as being embedded, i.e. to escaping the
- or a different quotation character for field quoting can be chosen, e.g. a single-quote
Before configuring anything here, please make sure that the other table-generating or consuming application will also support this.
Pattern
For denoting the most usual escape char, you can denote the back-slash
(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 theNo required manual action here, as this conversion will be handled automatically.