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 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). This notice changes only when Anthropic ships a new model.

Fable 5 and 5.1 subscription (updated September 7, 2026): Claude Fable 5.1, released September 1, 2026, is the current Fable model and Fable 5 is now legacy. Plan terms are the same for both — Max and Team Premium plans include Fable at up to 50% of the weekly usage limit; Pro and Team Standard use usage credits (

🟢 Model references match the current lineup · Claude Opus 5.5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). This notice changes only when Anthropic ships a new model.
0/M input, $50/M output tokens). The one-time
🟢 Model references match the current lineup · Claude Opus 5.5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). This notice changes only when Anthropic ships a new model.
00 credit applied only to the Fable 5 transition and is not offered for 5.1. Some coding and debugging requests may be answered by an Opus model due to a security classifier (both models). See the Fable 5.1 guide and the Fable 5 availability 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