CSV and JSON workflows: columns, types and round trips
Extract CSV columns, sort and filter rows, and convert data without confusing strings with numbers or losing nested JSON structure.
Check headers before editing
Select CSV columns accepts exact names such as name,age and outputs them in the requested order. Duplicate headers and inconsistent row widths are rejected.
To merge CSV, paste two tables or choose multiple files in source order. Every table must have identical headers in the same order. The result keeps one header and appends all records without deduplicating or joining by a key.
Flattening and restoring JSON now share one workspace selected by Task. Markdown table conversion similarly offers CSV → Markdown, Markdown → CSV and JSON → Markdown in one place.
Choose an explicit value type
Numeric sorting checks every value in the selected column. Choose text sorting for identifiers such as 0012 when their string representation matters. Filters support equals, not-equals and contains.
Column statistics ignore blank cells and report their count separately. A nonblank value that cannot be parsed as a number causes an error rather than being silently skipped.
Preserve container types in JSON paths
Flattening produces containers and values maps. Containers distinguish arrays from objects and preserve empty structures. Value paths use JSON Pointer escapes for slash and tilde characters.
Unflatten accepts this envelope only. Arbitrary dotted paths are ambiguous because a real key can contain dots, and a numeric object key is not necessarily an array index.
Pick a destination format
Markdown tables work well in readmes. Pipes are escaped and CSV line breaks become <br>. The reverse converter retains inline HTML literally, so a full formatting round trip is not promised.
CSV editing preserves original cell text, including values beginning with =, +, - or @. Check the safe CSV documentation before importing into spreadsheet software that evaluates formulas.
Use a small reference record throughout the workflow
Choose a row containing a quoted comma, a leading-zero identifier and a blank value. Keep this row in view as you extract columns, sort and convert. It exposes parsing and type changes that a table of simple numbers would hide.
For nested JSON, decide whether you want a human-readable summary or a reversible transformation. A Markdown table is useful in documentation but cannot represent every nested structure. The flatten/unflatten pair uses a containers-and-values envelope when reconstruction matters.
| Operation | Preserve | Verify |
|---|---|---|
| Extract columns | Requested order | Headers and a representative row |
| Sort rows | Complete records | Related cells move together |
| Merge CSV | Compatible headers | Count and column meaning |
| CSV to JSON | String identifiers | Leading zeros and empty values |
id,city,note
00123,"Portland, OR",
00456,Taipei,reviewBefore you finish
- Check header uniqueness before mapping columns to object keys.
- Compare record counts before and after filtering.
- Keep numeric identifiers as strings when their spelling matters.
- Import a sample into the final system before handing off the complete file.
References
- RFC 4180: CSV format
Reference for common delimiter and quoting conventions; spreadsheet import behavior varies.
- RFC 6901: JSON Pointer
Defines pointer paths and escaping, not Neatbo’s containers/values envelope.