Tablora · Library
Read a quote character inside a CSV field
In CSV, two double quotes inside a quoted field stand for one quote mark. See how the inspector reads She said "hello" and why backslashes fail.
How CSV writes a quote inside a value
A CSV field that contains a quote mark must itself be wrapped in quotes, and each quote inside it is written twice. So the cell text She said "hello" is stored in the file as "She said ""hello""". The outer quotes are syntax; each doubled pair inside stands for one literal quote character.
Some programs write a backslash before the quote instead, a convention borrowed from programming languages. The inspector follows the CSV rule, not that one, so a backslash-escaped quote is not accepted as an escape.
Checking the Poster row
The page example has a header item,note and one record whose note is "She said ""hello""", with comma as the Delimiter. The inspector reports 2 rows and 2 columns. Row 2, column 2 reads She said "hello", with exactly one quote mark before hello and one after it.
If you see two quote marks on either side of hello in the preview, the field was not quoted in the source and the text is probably not valid CSV at all.
Inputs that do not parse
- A quote mark in the middle of an unquoted field, such as She said "hi" without surrounding quotes, is rejected. The tool shows Check the entered values and try again instead of guessing where the field ends.
- A backslash before a quote does not escape it, so text exported with backslash escapes is rejected for the same reason.
- Characters after a closing quote, such as "hello"x, are also rejected.
- With Detect delimiter selected, the inspector tries comma, semicolon, tab and pipe, and reports an error only if none of them can parse the text.
- A quoted field must start right after a delimiter or at the start of a line, so a space before the opening quote is rejected as well.
Repairing and exporting quoted text
- Find the field in the original export and check whether the software that produced it has a standard CSV option.
- If you fix it by hand, wrap the whole field in quotes and double every quote inside it.
- Press Calculate again and confirm the cell shows single quote marks.
- Use Download (CSV) when the preview is right; the download writes the quotes back with the same doubling rule, so another program can read it.
Quote marks in app exports
The Tablora app's CSV export follows the same rule when a cell contains a quote, a comma or a line break: the cell is wrapped in quotes and inner quotes are doubled. In its XLSX export the quote is simply part of the cell text, so no escaping is visible to you.
Original synthetic example
- Input
- item,note Poster,"She said ""hello"""
- Delimiter
- ,
- Expected records
- 2
- Columns in the first record
- 2
- Cell to inspect
- Row 2, column 2: She said "hello"