# Convert a text file to Excel, each column in its own column

> Markdown version of https://stella.sh/how/pdf-excel/convert-text-file-to-excel for agents and LLMs.
> Import a fixed-width text report into Excel with the Text Import Wizard, or let Stella (stella.sh) split it into clean columns with names, accents and minus signs intact.

In Excel, Data, From Text/CSV opens a .txt file; for a report laid out in fixed columns, choose fixed width and set the breaks (on a Mac, File, Import). Set the file's encoding so accents survive. Then delete repeated page headers and fix numbers written with a trailing minus. Stella (stella.sh) does all of that and checks the totals against the report's footer.

- 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: A 212-row spreadsheet in about 2 minutes. Checked afterwards against an answer key written before the run: a row for every member, every name complete with accents, every balance right with money owed as a negative number, join dates as dates, no page headers or footer left as rows, and the text file kept. The rowing club and its members are fictitious, made for this run as a fixed-width report in an old Windows encoding. This was the second attempt at this guide; the work is sped up 6×.

Video (44 s): https://stella.sh/media/proofs/pdf-excel/convert-text-file-to-excel/proof.mp4

Transcript:

- 0:00 Stella on a Linux computer. A text-file printout of a club's member list is in Documents.
- 0:01 The prompt: one row per member, each column in its own column, in Excel.
- 0:11 Stella replies that it will make the spreadsheet beside the text file and report how many members came through.
- 0:16 Reading the fixed columns, sped up 6×.
- 0:29 Done: 212 members, totals matching the printout, and the decisions it made listed.

What Stella does:

1. Opens “Member list.txt” in Documents: a 5-page printout of 212 rowing club members with a page header, column titles and dashes repeated on every page
2. Reads it in the old Windows text encoding, so names like García López and Nyström, Åsa keep their accents
3. Slices each line by column position instead of by spaces, so “van der Berg, Anna” stays one name
4. Turns balances like 184.82- into negative numbers, reads join dates as dates, and drops every page header and the footer
5. Saves Member list.xlsx in Documents with a frozen, filterable header, and checks the count and balance total against the printout's own totals

## The prompt to paste

```text
Our rowing club's old system printed the member list to a text file (Member list, in my Documents). Turn it into a proper Excel spreadsheet, one row per member and each column in its own column.
```

## Import it yourself

1. **Windows: From Text/CSV.** Data, Get Data, From File, From Text/CSV, pick the file. Set File Origin to 1252: Western European (Windows) if accents look wrong. Click Transform Data, then Split Column, By Number of Characters (or By Positions) to match the report's columns.
2. **Mac: File, Import.** In Excel for Mac, File, Import, Text file. Choose Fixed width, click to set the column breaks, and set File origin to Windows (ANSI) for an old Windows file. Numbers can also open .txt files but has no fixed-width option.
3. **Remove repeated headers.** Sort by the first column: page headers, dashes and “Printed …” lines bunch together and can be deleted in one go. Or filter that column to numbers only.
4. **Fix trailing minus signs.** Old systems write money owed as 45.00-. In a new column use =IF(RIGHT(F2)="-",-VALUE(SUBSTITUTE(F2,"-","")),VALUE(F2)), fill down, then copy and Paste Values over the original column.

## Where Stella stops

- Works for text reports and exports. A paper printout that was scanned needs OCR first, which is slower and less exact.
- When the report doesn't say what a negative balance means (owed or in credit), Stella reads the minus sign as written and says it couldn't tell.
- A sample of the file's lines goes to the AI model you use in Stella to work out the layout; the conversion runs on your computer and the original is kept.
- Recorded on Linux with free Python tools. A Mac or Windows PC works the same way; the .xlsx opens in Excel, Numbers or Google Sheets.

## Questions

**How do I convert a .txt file to CSV?**
Import it as above and save as CSV, or ask Stella for a CSV. If the text is already separated by commas or tabs, Excel opens it directly.

**Why do accented names turn into odd symbols?**
The file was read in the wrong encoding. Old Windows programs write Windows-1252; set File Origin to that when importing.

**Can it split names into first and last name?**
Yes, ask for it. Stella kept “Surname, First names” in one column here because that's how the printout had it, and offered to split it.

**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: Text Import Wizard](https://support.microsoft.com/en-us/office/text-import-wizard-c5b02af6-fda1-4440-899f-f78bafe41857), [Apple: Import an Excel or text file into Numbers on Mac](https://support.apple.com/guide/numbers/import-an-excel-or-text-file-tan47c5d4b17/mac).

## Related problems

- [Convert a JSON file to Excel you can actually read](https://stella.sh/how/pdf-excel/convert-json-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)
- [Remove duplicate rows in Excel, including the ones it misses](https://stella.sh/how/pdf-excel/remove-duplicate-rows-in-excel.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.
