# Clean up a spreadsheet export

Give it a messy export. Get every row back in order, exceptions flagged, totals scoped.

## Start

1. Edit [brief.md](spreadsheet-cleanup/files/brief.md) and [input-template.md](spreadsheet-cleanup/files/input-template.md).
2. Supply authorized inputs to your own file-capable agent with [instruction.txt](spreadsheet-cleanup/files/instruction.txt).
3. Inspect the saved outputs using [checks.md](spreadsheet-cleanup/files/checks.md) before using them. Keep original inputs.

## Inputs

- Original CSV or spreadsheet export
- Rules for dates, currency, duplicates and acceptable corrections

## Outputs

- Cleaned copy with original values retained
- Exception log
- Row counts and scoped totals

## Steps

- Upload a copy of the export and the cleaning brief.
- Run the instruction and inspect the exception log first.
- Check row counts, ID text handling and the eligible rows behind each total.

## Instruction

Clean the export I supply according to its brief. Work on a new copy; preserve the original and all source rows. If cleaning rules are absent, propose safe rules and ask before applying changes that alter meaning.

Keep identifiers as text, including leading zeros. Retain original date and amount fields and add normalized fields. Apply only unambiguous transformations supported by the brief. Leave unclear values unchanged in the original fields and log the issue; never turn an unknown amount into zero or assume a currency. Flag exact duplicates and conflicting records separately. Do not silently remove or merge either kind.

Save cleaned.csv, exceptions.csv and reconciliation.md. The exception log must identify the source row/ID, issue, treatment and decision needed. Reconcile input/output row counts. State which rows are included in any numeric totals and why others are excluded. Sum only known, eligible numeric values by currency; do not combine currencies without an authorized conversion rule. Treat these as scoped totals, not a final accounting total.

Return the saved files and unresolved decisions. Do not write to a live system, overwrite inputs or send data elsewhere.

## Decisions that need your context

- Two amounts conflict for one ID
- Dates or amounts with unknown locale
- Missing currency or pending amount
- No cleaning rules supplied
- Any currency conversion

## Settled by the brief

- An exact copy of an earlier row: flag it, keep both, count it once.
- Extra spaces around a name: trim them in the added column.
- A lowercase cost-center code: uppercase it in the added column.
- An amount in brackets: read it as a negative refund.

## Check the output

- Original rows and values are recoverable; leading-zero IDs remain text.
- Duplicates are retained and flagged until a decision is supplied.
- Ambiguous dates, missing currency and unknown amounts are not guessed.
- Totals use stated eligible rows and separate currencies.

## Limits

- A spreadsheet application may strip leading zeros when opening CSV; import ID columns as text.
- An exception log requires a human decision before ambiguous records can be finalized.
- Access instructions do not replace configured tool permissions.

## Materials

- [examples/spreadsheet-cleanup/cleaned.csv](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/cleaned.csv)
- [examples/spreadsheet-cleanup/designed-example.html](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/designed-example.html)
- [examples/spreadsheet-cleanup/designed-example.md](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/designed-example.md)
- [examples/spreadsheet-cleanup/exceptions.csv](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/exceptions.csv)
- [examples/spreadsheet-cleanup/input.csv](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/input.csv)
- [examples/spreadsheet-cleanup/input.md](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/input.md)
- [examples/spreadsheet-cleanup/recorded-run/input.md](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/recorded-run/input.md) (original recorded evidence; links retain their recorded form)
- [examples/spreadsheet-cleanup/recorded-run/instruction.txt](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/recorded-run/instruction.txt) (original recorded evidence; links retain their recorded form)
- [examples/spreadsheet-cleanup/recorded-run/output/cleaned.csv](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/recorded-run/output/cleaned.csv) (original recorded evidence; links retain their recorded form)
- [examples/spreadsheet-cleanup/recorded-run/output/exceptions.csv](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/recorded-run/output/exceptions.csv) (original recorded evidence; links retain their recorded form)
- [examples/spreadsheet-cleanup/recorded-run/output/reconciliation.md](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/recorded-run/output/reconciliation.md) (original recorded evidence; links retain their recorded form)
- [examples/spreadsheet-cleanup/recorded-run/report.html](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/recorded-run/report.html) (original recorded evidence; links retain their recorded form)
- [examples/spreadsheet-cleanup/recorded-run/report.md](spreadsheet-cleanup/files/examples/spreadsheet-cleanup/recorded-run/report.md) (original recorded evidence; links retain their recorded form)
- [field-tests/expense-cleanup/claude-sonnet/cleaned.csv](spreadsheet-cleanup/files/field-tests/expense-cleanup/claude-sonnet/cleaned.csv) (original recorded evidence; links retain their recorded form)
- [field-tests/expense-cleanup/claude-sonnet/exceptions.csv](spreadsheet-cleanup/files/field-tests/expense-cleanup/claude-sonnet/exceptions.csv) (original recorded evidence; links retain their recorded form)
- [field-tests/expense-cleanup/claude-sonnet/reconciliation.md](spreadsheet-cleanup/files/field-tests/expense-cleanup/claude-sonnet/reconciliation.md) (original recorded evidence; links retain their recorded form)
- [field-tests/expense-cleanup/claude-sonnet/reply.md](spreadsheet-cleanup/files/field-tests/expense-cleanup/claude-sonnet/reply.md) (original recorded evidence; links retain their recorded form)
- [field-tests/expense-cleanup/claude-opus/cleaned.csv](spreadsheet-cleanup/files/field-tests/expense-cleanup/claude-opus/cleaned.csv) (original recorded evidence; links retain their recorded form)
- [field-tests/expense-cleanup/claude-opus/exceptions.csv](spreadsheet-cleanup/files/field-tests/expense-cleanup/claude-opus/exceptions.csv) (original recorded evidence; links retain their recorded form)
- [field-tests/expense-cleanup/claude-opus/reconciliation.md](spreadsheet-cleanup/files/field-tests/expense-cleanup/claude-opus/reconciliation.md) (original recorded evidence; links retain their recorded form)
- [field-tests/expense-cleanup/claude-opus/reply.md](spreadsheet-cleanup/files/field-tests/expense-cleanup/claude-opus/reply.md) (original recorded evidence; links retain their recorded form)
- [field-tests/expense-cleanup/claude-haiku/cleaned.csv](spreadsheet-cleanup/files/field-tests/expense-cleanup/claude-haiku/cleaned.csv) (original recorded evidence; links retain their recorded form)
- [field-tests/expense-cleanup/claude-haiku/exceptions.csv](spreadsheet-cleanup/files/field-tests/expense-cleanup/claude-haiku/exceptions.csv) (original recorded evidence; links retain their recorded form)
- [field-tests/expense-cleanup/claude-haiku/reconciliation.md](spreadsheet-cleanup/files/field-tests/expense-cleanup/claude-haiku/reconciliation.md) (original recorded evidence; links retain their recorded form)
- [field-tests/expense-cleanup/claude-haiku/reply.md](spreadsheet-cleanup/files/field-tests/expense-cleanup/claude-haiku/reply.md) (original recorded evidence; links retain their recorded form)

## Evidence

[Recorded context and file identities](spreadsheet-cleanup/files/evidence.json)

Recorded run

One synthetic expense file, one instruction, one run each: Codex, then Sonnet, Opus and Haiku in Claude Code. All preserved run-folder outputs are published. These are single runs, not a benchmark.

Observed or source-checked: 2026-10-13.

## Revision and corrections

Revision: 2.0.1. Lifecycle: active.

[Current kit](https://codexwork.com/kits/spreadsheet-cleanup/) · [Changes and corrections](https://codexwork.com/changes/)

[Rights and notices](spreadsheet-cleanup/files/LICENSES.md) · [Sources](spreadsheet-cleanup/files/sources.md) · [Manifest](spreadsheet-cleanup/files/manifest.json)

Downloading these files does not run an agent, install a skill, create a schedule, or grant file or account permissions.
