# Convert Excel to CSV, keeping leading zeros and dates

> Markdown version of https://stella.sh/how/pdf-excel/convert-excel-to-csv for agents and LLMs.
> Save each Excel sheet as CSV without losing leading zeros or turning dates into numbers, or let Stella (stella.sh) export every sheet at once and check each cell.

In Excel, File, Save As, CSV UTF-8 saves only the sheet you're on, so repeat for each sheet. Leading zeros that come from a number format (00417) can be lost, so make those columns Text first. Check the result in a text editor, because Excel hides the zeros again when it reopens a CSV. Stella (stella.sh) exports every sheet at once and checks each cell against the workbook.

- Checked: 14 November 2026
- Stella does it on: Windows, Mac, Linux

## Stella doing it

Recorded 14 November 2026 on Linux (Omarchy) with Claude Code with Opus, on a Claude plan.
Result: Three CSV files in about 2¼ minutes. Checked afterwards against an answer key written before the run: Members and Payments each saved as CSV, all 64 members, member numbers and ZIP codes with their leading zeros, dates as real dates (not serial numbers), accented names right in UTF-8, addresses with commas kept in one field, every payment right, and the workbook unchanged. The swim club and its members are fictitious, made for this run. The work is sped up 7×.

Video (51 s): https://stella.sh/media/proofs/pdf-excel/convert-excel-to-csv/proof.mp4

Transcript:

- 0:00 Stella on a Linux computer. A swim club membership workbook with three sheets is in Downloads.
- 0:01 The prompt: a CSV for each sheet, leading zeros kept, dates as proper dates.
- 0:17 Stella replies that it will write dates as YYYY-MM-DD and leave the original unchanged.
- 0:22 Exporting each sheet and checking every cell, sped up 7×.
- 0:36 Done: Members, Payments and Read me as CSV, zeros kept, and eight suspicious payments flagged.

What Stella does:

1. Opens “Swim club members.xlsx” in Downloads: a Members sheet (64 members, numbers and ZIP codes shown with leading zeros), a Payments sheet with a total row, and a short Read me sheet
2. Writes one CSV per sheet in UTF-8, so accented names come through, with addresses that contain commas quoted as one field
3. Keeps member numbers and ZIP codes as the five digits you see (00402, 01776) and writes dates as 2022-09-18
4. Leaves the blank row and the Total row out of Payments.csv so a website doesn't load the total as a payment, and checks the 40 payments still add up
5. Saves them in a new folder next to the workbook, which is unchanged, and flags eight $1,250.00 payments that look like typos for $125.00

## The prompt to paste

```text
The swim club's membership spreadsheet is in my Downloads and the new membership website needs it as CSV files, one for each sheet. The member numbers and zip codes have to keep their leading zeros, and the dates need to come out as proper dates.
```

## Save the CSVs yourself

1. **Make zero-padded columns Text.** If ZIP codes or member numbers show zeros only because of a number format, add a column with =TEXT(A2,"00000"), fill down, copy and Paste Values over the original. Now the zeros are part of the value.
2. **Save each sheet.** Click a sheet's tab, then File, Save As (or Save a Copy), and choose CSV UTF-8 (Comma delimited). Excel warns that only the active sheet is saved; that's expected. Repeat for every sheet under its own name.
3. **Dates.** A CSV stores dates as text in whatever format the cell shows. For a website, format date columns as yyyy-mm-dd first (Format Cells, Custom) so there's no doubt about day and month.
4. **Check in a text editor.** Open the CSV in Notepad or TextEdit, not Excel: Excel drops leading zeros again when it opens a CSV, even when they're in the file. Look for 00417 and a few dates.

## Where Stella stops

- A CSV holds values only: colours, formulas and several sheets in one file can't survive. Totals are written as their values, or left out if they'd be read as data.
- Opening the CSV in Excel again hides the leading zeros on screen, even though they are in the file.
- The workbook's content goes to the AI model you use in Stella as it checks the export; the files are written on your computer.
- Recorded on Linux with free Python spreadsheet tools. A Mac or Windows PC works the same way.

## Questions

**How do I convert CSV back to Excel?**
Open it with Data, From Text/CSV and set the zero-padded columns to Text in the preview, then save as .xlsx. For text reports, see [convert a text file to Excel](https://stella.sh/how/pdf-excel/convert-text-file-to-excel).

**Why do my dates become numbers like 45231?**
That's Excel's internal date number, written by tools that ignore the cell's format. Save from Excel itself, or ask for ISO dates.

**Can I convert a Numbers file instead?**
Yes: [convert Numbers to Excel](https://stella.sh/how/pdf-excel/convert-numbers-to-excel), then save as CSV.

**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.

Sources: [Microsoft: Import or export text (.txt or .csv) files](https://support.microsoft.com/en-us/office/import-or-export-text-txt-or-csv-files-5250ac4c-663c-47ce-937b-339e391393ba), [Microsoft: Keeping leading zeros and large numbers](https://support.microsoft.com/en-US/Excel/keeping-leading-zeros-and-large-numbers).

## Related problems

- [Convert a Numbers file to Excel, even without a Mac](https://stella.sh/how/pdf-excel/convert-numbers-to-excel.md)
- [Split a CSV file into multiple files that open in Excel](https://stella.sh/how/pdf-excel/split-csv-file-into-multiple-files.md)
- [Change dates in Excel from US to UK when they come out wrong](https://stella.sh/how/pdf-excel/fix-dates-in-excel.md)
- [Convert a contacts CSV to a VCF file for your phone](https://stella.sh/how/contacts-calendar-email/convert-csv-to-vcf.md)
- [Convert bank statement PDFs to Excel](https://stella.sh/how/pdf-excel/bank-statement-pdf-to-excel.md)
- [Reduce PDF file size when it's too large to email](https://stella.sh/how/pdf-excel/compress-pdf-too-large-to-email.md)

Get Stella: https://stella.sh/download. Free with the ChatGPT or Claude plan you already have.
