Handle commas, quotes and line breaks in CSV
Read a tricky record correctly instead of splitting on every comma.
A comma does not always end a field
CSV is simple text, but splitting each line on commas is not a reliable parser. A field may contain its own comma, quotation mark or line break. RFC 4180 describes enclosing such fields in double quotes and doubling a quote that belongs inside the field.
id,note 00127,"Notebook, blue" 00904,"He said ""ready""" 00008,"First line Second line"
There are four logical records here: a header and three data records. There are five physical text lines. The final note spans two physical lines but remains one field in one record.
Read the example as a table
The first note is Notebook, blue, including its comma. The second note is He said "ready", including the quotes. The third note retains the line break between its two sentences. Quoting is structure around the field; doubled quotation marks represent content inside it.
Preview before an export
- Copy the complete example into either TableMender tool.
- Select comma as the input delimiter and keep the header option checked.
- Preview. The data-record count should be three and the column count two.
- Inspect the notes. They should not become extra columns or separate records.
A strict error can be useful
An opening quote without a closing quote leaves the record boundary uncertain. A quote in the middle of an unquoted field is also ambiguous. TableMender stops instead of inventing an interpretation. It reports the logical record associated with the error; that number can differ from the physical line number when earlier fields contain line breaks.
It also rejects unexpected text after a closing quote. Check whether the delimiter is wrong before editing the content. Some nonstandard exporters add spaces around quoted fields; this first version does not silently normalize that dialect.
Round trips need explicit choices
Changing a separator requires re-serializing parsed fields. The repair tool quotes fields when needed, doubles embedded quotes and uses CRLF between records. These changes can alter file bytes while keeping parsed field content intact. Formula protection is a separate option that intentionally changes selected values by prefixing an apostrophe.
Keep the scope clear
The tool supports common quoted-field CSV plus explicit semicolon, tab and pipe separators. It does not import an existing XLSX file or a proprietary binary export. Preserve your original and check the new file in its receiving application.
Sources:
Examples are original teaching data. Tool-specific behavior describes this version of TableMender; software interfaces can vary by version.