Skip to main content

Cleaning Messy Text into CSV and JSON with Claude — Practical Data Tidying

Practical ways to turn messy, copied text into a clean table (CSV) or JSON with Claude — building tables, standardizing dates and units, deduping and fixing typos, and extracting fields. Large inputs can drop or misplace rows, so always check the result.

🌐 This article was machine-translated and may contain inaccuracies. Read the Korean original if in doubt.

When you need to turn messy, copied text into a clean table (CSV) or JSON, paste it into Claude and say "tidy this up like so." This guide covers practical ways to clean and convert unstructured text into structured data — building tables, standardizing formats, deduping and fixing typos, and extracting fields. (Cleaned data can drop or mis-handle rows as volume grows, so always check the result.)

🟢 Model references match the current lineup · model notice · Fable subscription
🟢 Model references match the current lineup · Claude Opus 5.5 / Claude Sonnet 5.5 / Claude Haiku 5.5 (higher tier: Claude Fable 5.2). This notice changes only when Anthropic ships a new model.

Fable subscription (updated November 10, 2026): Claude Fable 5.2, released November 9, 2026, is the current Fable model; Fable 5.1 and Fable 5 are now legacy. Plan terms are the same for all three — Max and Ultra plans and premium seats on Team and seat-based Enterprise plans include Fable at up to 50% of the weekly usage limit; Pro plans and standard seats use usage credits (not available on Free). As a launch offer, Fable models are also included for Pro plans and Team standard seats at up to 50% of the weekly limit through November 16, 2026 (PT). API pricing is $8/M input and $40/M output tokens for Fable 5.2, and $10/$50 for Fable 5.1 and 5. Some cybersecurity and biology requests may be answered by an Opus model due to safety classifiers. See the Fable 5.2 launch news and the Fable 5.2 guide for details.

Four kinds of data cleanup with Claude Into a table turn a flat list into rows/columns Standardize align dates, phones, units Dedupe & fix typos merge duplicates, correct typos Extract fields pull just the values you want Any format — CSV, JSON, table. For large inputs, always check the row count.

1. What "data cleanup" means here

"Cleanup" sounds grand, but in practice it's tasks like these.

  • Into a table: turn a flat list or roster into rows and columns (CSV)
  • Standardize: align inconsistent dates (2026.6.22 / Jun 22), phone numbers, and units into one format
  • Dedupe and fix typos: merge duplicate entries, correct spacing and typos
  • Extract fields: pull just the values — names, amounts, dates — out of prose

2. Writing a good cleanup request

Give three things together for clean results: the source + the format you want + the rules.

"Tidy the text below into CSV. Columns in this order: name, contact, signup date. Standardize dates to YYYY-MM-DD and merge duplicate people. [paste text]"
  • Name the columns (fields) and their order yourself
  • State rules like "leave missing values blank" or "use one currency unit"
  • Ask for the result in a code block to copy it easily
CSV vs JSON — which to chooseCSVPaste straight into Excel/SheetsBest for simple rows & columnsJSONUse in code and programsBest for nested structuresCSV for spreadsheets · JSON for code

3. CSV or JSON?

  • CSV: table data to paste straight into Excel or Google Sheets. Good for simple rows and columns.
  • JSON: for use in programs, or when one entry holds several nested sub-values.

A simple rule: "CSV for a spreadsheet, JSON for code."

Things to watch for

  • Verify large volumes: with hundreds of rows, some can be dropped or mis-sorted. Count them, and split very large inputs into batches.
  • Preserve original values: tell it to "leave missing values blank" so Claude doesn't "guess" and fill them in.
  • Mind sensitive data: rather than pasting real personal or customer data, mask it or use example values.

FAQ

Q. I want finer control over output formats like tables or JSON.
Output formatting in general is covered separately. → Specifying Claude's output format

Q. I need JSON output "guaranteed" in development.
The API can enforce output with a schema. → Claude API structured outputs

Q. My data is too long and gets cut off.
Reduce how much you paste at once, process in batches, and stitch the results together.

For office work in general, see Claude for work.

Was this helpful?

Keep reading