๐Ÿ“š General & Other

Splitting on a Delimiter Is Not the Same as Parsing CSV

splits on commas. For a simple list that is correct and instant. For anything claiming to be CSV, it is a bug waiting to be discovered downstream.

tr ',' '\n' splits on commas. For a simple list that is correct and instant. For anything claiming to be CSV, it is a bug waiting to be discovered downstream.

Quoted fields contain delimiters

"Smith, John",42 is two fields. Split naively on the comma and it becomes three, with a stray quote on two of them. Every row containing a quoted comma shifts its columns by one, so the damage is silent and structural rather than obvious.

Escaped quotes inside quoted fields

CSV escapes a quote by doubling it, so "He said ""hello""" is one field. No delimiter-splitting approach handles that; it needs an actual parser tracking whether it is currently inside a quoted region.

The rule of thumb

If the data is a plain list of values that will never contain the delimiter โ€” keyword lists, URL lists, ID lists โ€” splitting is correct and a parser is overkill. The moment values might contain the delimiter, use a real CSV reader. The failure mode of getting this wrong is not an error message; it is quietly misaligned data that looks plausible.

Try it: Split a Delimited String into Lines on SeoWolf's Notepad.