Automation · Data Formats
CSV
Cheat sheet · https://pcornel.dk/topic.php?topic=5835
Answer
CSV (comma-separated values) stores tabular data as text rows, easy to export from spreadsheets and import into scripts with Import-Csv or Python's csv module, but with no data types or nesting.
Remember
- No data types or nesting.
- Delimiters vary.
- Use a real parser.
First checks
head -3 file.csv— header and samplecsvlint / python csv check— validityfile file.csv— encoding
Verify in this order
CSV → parser → rows → validation
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Data Formats → CSV · operational reference
| Layer | Data Formats → CSV operational reference |
|---|---|
| Runtime/ownership | CSV interchange and automation parsers · the CSV producer/parser pair interpreting records, fields, quoting and line boundaries |
| Persistent intent | documented dialect contract: delimiter, quote character, header presence, encoding, newline policy and null/empty conventions |
| Verification | Parse a fixture containing commas, quotes, CRLF/newlines and empty fields with the production parser settings; serialize it again and compare field values and column count. |
| Expected interpretation | Each logical record and field round-trips without delimiter/quote corruption, headers map deterministically, and malformed rows are rejected or surfaced rather than silently shifted. |
| Recovery boundary | preserve the original bytes and parser settings, correct the dialect/schema mismatch instead of hand-editing rows, then reparse the same fixture and compare typed records |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5835