Skip to main content
All AI tricks
Quick trickProductivityBeginner

Claude CSV Cleanup: Keep Leading Zeros and Text IDs

Tell Claude which columns are identifiers before cleaning a CSV. Check leading zeros, scientific-looking IDs and spreadsheet import types before accepting the file.

6 min practiceClaudeUpdated · Last checked Oct 18, 2026
Jump to the lesson ↓
Identifier tags remain in protective sleeves beside counting beads, illustrating string preservation with a Claude logo.
AI-generated conceptual illustration with a provider logo used for editorial identification. Not a screenshot, product test or sponsored endorsement.

The useful result

Preserve identifier strings exactly while normalizing only permitted numeric columns.

  • Preserve identifier strings exactly while normalizing only permitted numeric columns.

An identifier that looks numeric may still be text. If a cleanup turns 0017 into 17, a record can stop matching its source even though the column looks tidier. Give Fable a column contract before asking for normalization, and check the exported text as well as what a spreadsheet displays.

Fable 5.1 requires eligible paid access; plan inclusion and usage credits differ. Check the linked account guide. You can practise the technique on the supplied fictional inputs with an available compatible assistant first. This lesson is documentation-based; examples are expected results, not a claim that we ran the named model.

Before you start

  • A fictional CSV: id,quantity with rows 0017,2 and 1E10,3.
  • A plain-text viewer and, optionally, a spreadsheet with explicit import column types.

Review evidence

Documentation-based review · 2026-10-18

Provider documentation checked on 18 October 2026. Examples and checks are original illustrative exercises, not recorded platform tests. Cover artwork is conceptual and does not imply provider sponsorship.

1

Declare the column contract

Mark id as an exact string and quantity as an integer. Do not let the assistant infer data types from appearance. Keep a copy of the original CSV and identify which transformations are allowed, such as trimming outer spaces from quantity.

Example / expected result

Illustrative example; not a recorded model result.

Protected IDs: “0017” and “1E10”. Allowed quantity values: integers 2 and 3.

Check your result

The contract explicitly protects leading zeros and scientific-looking identifiers.

2

Request a transformation log

Ask for the cleaned CSV plus a record of permitted changes and unresolved values. Require a separate report if a proposed change would affect an identifier. Keep descriptions outside the CSV block.

Try this prompt
Clean this fictional CSV using id as an exact string and quantity as an integer: id,quantity / 0017,2 / 1E10,3. Preserve every id character, including leading zeros. Return one CSV block and a separate change log. Do not infer missing rows or silently repair identifiers.

Example / expected result

Illustrative example; not a recorded model result.

id,quantity "0017",2 "1E10",3 Change log: no identifier changes.

Check your result

IDs remain byte-for-byte identical; no numeric expansion of 1E10 occurs.

3

Check export and import independently

Inspect the raw file in a text viewer. If opening it in a spreadsheet, import the identifier column as Text; CSV quotes alone do not force every spreadsheet to preserve its type. Compare the resulting values with the original IDs before using joins or lookups.

Check your result

Both raw CSV and imported cells retain 0017 and 1E10 exactly.

When it goes wrong

An application may change types after the AI has produced a correct file. CSV has no universal column-type metadata. Dates, long numbers and postal codes also need explicit handling; do not repair a real ID from guesswork.

Make it your own

Add ID 00003 and a quantity of 4. Keep the three IDs unchanged, then check that the quantity total is 9 without summing or transforming the identifier column.

Useful next resources

Sources and review

Last checked Oct 18, 2026. Features and account limits can change. Verify important results against your original material.

Did this help you complete your task?

Tell us what needs improving. No account or private output required.

Was this useful?
Report incorrect information or a broken link

Genius Forges Editorial

Practical AI lessons with checked sources, labelled examples and human verification.

Keep building your AI habits

Keep learning useful AI tricks

Get practical lessons and resources when we publish them.

Turn this idea into a daily skill

Practice with a small input and check the result before sharing.

We use optional cookies for analytics and referral tracking. Learn more about our privacy policy