# CSV

A spreadsheet that lost its formatting, and every ambiguity that implies.

## How it opens

CSV parses into the records shape — many rows of the same shape, browsed as a list with a per-row view.

Nothing is chosen by file extension alone: every adapter scores the text itself and the highest confidence wins. When two are close enough that guessing would be a coin flip, the app asks instead of picking.

- extensions · .csv
- media type · text/csv
- shape · records
- extra diagnostics · this adapter lints beyond what parsing reports

## Fixing

5 steps run over a CSV document, in this order. Nothing is applied until you say so, and each fix can be kept or dropped on its own.

- Quote and escape a field containing an unescaped quote
- Rejoin a European decimal that a comma delimiter split in two — a judgment call — excluded from safe-repair-on-paste
- Normalize European thousands + decimal notation (1.240,00 → 1240.00) — a judgment call — excluded from safe-repair-on-paste
- Pad a short row so its cells line up with the header — a judgment call — excluded from safe-repair-on-paste
- Keep a leading-zero value as text instead of a number — a judgment call — excluded from safe-repair-on-paste

A judgment call can say something your document did not, so it is separated from the mechanical ones on purpose.

## Nesting

A CSV value can hold another system's output — a stringified body, an escaped document. Unpack opens it in place, names the parser that opened it, and repeats until nothing parses. Pack restores the original text byte for byte rather than re-serializing from the tree.

## A sample

The document below is the fixture this adapter ships and its own tests parse — not an illustration written for this page.

```
sku,title,qty,unit_price,tax_rate
BRD-OAK-002,"Oak End Grain Cutting Board",1,124.00,0.0875
OIL-MNRL-008,Food Safe Mineral Oil 8oz,2,12,50,0.0875
BRD-WAL-114,"Walnut Board, 18""",1,1.240,00,0.0875
KNF-CHF-201,Chef Knife 8",1,89.00
SPN-SET-003,Spoon Set,007,24.00,0.0875
```

---

Canonical: https://unstringify.com/docs/csv
