Reading — step 1 of 5
Read
~1 min readThe Basics
CSV Basics
CSV (Comma-Separated Values) is the lingua franca of tabular data. Conceptually trivial:
name,age,city
Alice,30,NYC
Bob,25,LA
Each line is a row; commas separate columns; the first row is often a header.
In practice CSV is shockingly inconsistent across tools:
- Excel uses
;in some locales (because comma is the decimal separator) - Different line endings (
\nvs\r\nvs\r) - Different quote characters (
"is standard but'happens) - Various escape rules
RFC 4180 standardized the format in 2005, but many parsers are lenient.
Required handling:
- Field separators
- Line endings
- Quoted fields (with escaped quotes inside)
- Empty fields
- Numeric vs string fields (no type info — caller decides)
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…