Split a CSV file into multiple files that open in Excel
A 1.15-million-row export split into three parts that each open fully in Excel.
A real run on 14 November 2026, on a Linux computer, using Claude Code with Opus, on a Claude plan. The waiting is sped up; it took 1 min 08 s in real time.
The short answer.
Excel stops at 1,048,576 rows and drops the rest. Split the CSV into parts under that size and copy the header row into each. On a Mac or Linux, split -l cuts by line, but breaks any record whose text has a line break inside quotes. Stella (stella.sh) splits by record instead, puts the header in every part and checks nothing is lost.
Stella does this on Windows, Mac and Linux.
What happened.
Three CSV parts in about 1¼ minutes. Checked afterwards against an answer key written before the run: every part starts with the header and fits in Excel, together they hold exactly the 1,150,000 original records byte for byte (none broken by the multi-line notes), in the original order, and the original is unchanged.
The sales export is fictitious, generated for this run (67 MB, 8 columns). The work is sped up 2×.
How Stella does it.
- Opens “Sales export 2019-2026.csv” in Downloads: 1,150,000 records, more than Excel's 1,048,576-row limit
- Reads it record by record, so the 90 notes with a line break inside quotes stay whole instead of being cut in two
- Writes three parts of 500,000, 500,000 and 150,000 rows, each starting with the header row, in a new folder next to the original
- Checks that the parts together hold exactly the original records, none lost, repeated or changed, in the original order
- Leaves the original export unchanged
The prompt.
The sales export CSV in my Downloads is too big for Excel, it cuts off the rows at the bottom. Split it into smaller files that each open fully in Excel, with the header row in every file.
This is the exact prompt from the recording. If your files are somewhere else, say where.
Do it yourself.
Check the size first
Excel holds 1,048,576 rows including the header. If Excel shows a “file not loaded completely” message or the last rows are missing, the file is bigger than that.
Mac or Linux: split
In Terminal:
tail -n +2 big.csv | split -l 1000000 - part_makes parts without the header; then add it back withfor f in part_*; do (head -1 big.csv; cat $f) > $f.csv; done. Only safe when no field contains a line break.Windows: PowerShell
Import-Csvreads quoted line breaks correctly; a short script can export every million records withExport-Csv. It's slow on large files. Free CSV splitter programs exist too: check they keep the header.Or don't split
If you only need totals, Excel can load the whole file into its Data Model: Data, From Text/CSV, Load To, Only Create Connection, and tick Add to Data Model. Then summarise it with a PivotTable.
Where it stops.
- Splitting doesn't add up or analyse anything; ask for a summary if that's what you need.
- Very large files (several GB) take a few minutes and need free disk space for the parts.
- Only the first lines go to the AI model you use in Stella to see the layout; the split itself runs on your computer.
- Recorded on Linux with Python's built-in CSV reader. A Mac or Windows PC works the same way.
Questions.
Can I split a CSV by a column's value instead of by size?
Yes, ask for one file per value. For an Excel sheet, see split an Excel sheet into multiple files.
Why does `split` break some rows?
It cuts on line breaks, and a quoted field (like a note) can contain one. A CSV-aware tool keeps the record whole.
How do I join the parts back together?
Ask Stella, or see combine Excel files into one sheet; the result still can't exceed Excel's row limit in one sheet.
Is Stella free for this?
Yes. Free with the ChatGPT or Claude plan you already have. Sign in with your ChatGPT plan, or use your Claude plan through Claude Code, and this task costs nothing extra. New accounts also get a small free trial of Stella’s own models.
Can I control what Stella changes on my computer?
Yes. Stella works on Windows, Mac and Linux with your own files and shows each step in the chat, so you can watch it and stop it at any point. Tell it what it may not do, as the prompts on these pages do (“don't delete anything without asking”). In the Downloads recording it deleted nothing until it was told to go ahead. It also refuses commands that would wipe a whole disk, your home folder or system folders.
Checked against these sources on 14 November 2026.