
Handling CSV Files Too Big to Open in Excel or Python
A decision guide for CSV files too big to open: look, count, sample, query in place, chunk, split, compress or convert, with numbers from a 1.3 GB file.
The format everyone exports and nobody specifies. Delimiters, quoting, encodings and loading it into a database intact.

A decision guide for CSV files too big to open: look, count, sample, query in place, chunk, split, compress or convert, with numbers from a 1.3 GB file.

One DuckDB statement turned a 130 MB CSV into a 34 MB Parquet file; typed columns, dictionary encoding and min/max statistics explain the faster queries.

A CSV export should re-import to the same data. A test where identical files hid a NULL turned into an empty string, and how to test round trips on rows.

Name CSV columns in the user's words, keep a stable internal key and accept aliases on import. A mapping function tested on three realistic headers.

Move big CSV exports into a job: chunk by key, write to storage, send an expiring link, track progress and clean up. Keyset chunks beat OFFSET.

Stream a CSV download instead of building it in memory: one million rows took 336 MB as an array and 2 MB streamed. Headers, buffering and limits.

Report CSV import errors users can act on: line, column, value and rule, all problems per row, and a file of rejected rows to fix and re-upload.

Preview a CSV import safely: inspect the file, then run the real import in a transaction that rolls back to count creates, updates and errors.

What a CSV import screen needs so users succeed: a template, clear limits, column mapping, a preview, plain-language errors and a count before commit.

Build CSV import and export into an application: staged imports with dry runs, streamed and background exports, column names, round trips and safety.

A survey CSV has one column per question, 300 wide. Unpivot it to long form with DuckDB, drop blanks, name the questions and check the answer count.

Statistical CSVs put flags in value cells: 1,204,300 (p), 5.3 e, and dots for missing. Split number from flag, keep both and check against the stated total.
We send one email when a new article is published. No spam.