Convert a Markdown Table to CSV or JSON with Row and Column Validation
You get a clean CSV or JSON conversion of your Markdown table, plus a row-and-column count check that flags any ragged rows.
Text prompt for ChatGPT and Claude
Prompt
Act as a data formatting specialist. Your job is to convert a Markdown table I paste into clean CSV or JSON, while verifying that no data is lost or misaligned.
First, ask me two short questions in one message and wait for my reply:
1. Do you want CSV or JSON output?
2. Should empty cells be kept as empty strings or null?
Once I reply and paste my Markdown table, follow these rules:
- Strip Markdown pipe characters, alignment rows (such as --- or :---:), and leading or trailing whitespace from every cell.
- Count the columns in the header row and check every data row against that count. Flag any ragged rows that have fewer or more cells than the header.
- For CSV, wrap any cell containing commas, quotes, or line breaks in double quotes, and escape internal double quotes by doubling them.
- For JSON, output an array of objects using the header names as keys, preserving the original row order.
- Do not invent missing values or silently drop extra cells.
Output format:
1. Validation Summary (input rows, output rows, expected columns, and a list of any ragged rows by row number)
2. Converted Output (inside a fenced code block)
End with one line noting any assumptions made about headers, data types, or ragged rows.Example output
Tips and common edits
Why this works
- Forces a column-count check against the header so ragged rows are caught before import.
- Specifies exact CSV quoting rules for commas and double quotes to prevent broken columns.
- Prohibits inventing missing values or silently dropping extra cells.
Use this in ChatGPT, Claude, or Gemini when moving Markdown tables from docs or AI chats into spreadsheets or scripts. Have your Markdown table ready to paste.
Common edits
- Ask for semicolon-delimited or tab-separated output instead of comma-separated CSV.
- Add a rule to convert header names to snake_case when outputting JSON.
Reuse it: Use in a workflowTurn into a skillAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Classify Customer Reviews by Sentiment and Topic with Verbatim Quotes
Get a summary count table of your customer reviews grouped by topic and sentiment, paired with one verbatim quoted example for each topic.
Clean Copy-Pasted PDF Text Without Changing Original Wording
Get clean, readable text from messy PDF copy-pastes with broken lines, split hyphens, and stray headers removed while keeping the original wording.
Plan Dataset Anonymisation with a Column-by-Column Action Table
Get a column-by-column anonymisation plan specifying whether to drop, mask, bucket, or keep each field before sharing data externally.
Redact Personal Information with Consistent Tokens and an Audit Log
Get your pasted text back with personal details replaced by consistent typed tokens, plus a separate audit table showing every masked item.
Turn Voice-Memo Transcripts into Decisions, Actions, and Questions
You get clean, structured notes from a rambling voice-memo transcript, sorted strictly into verified decisions, action items with owners, and open questions.
Spec and Build a Weekly KPI Dashboard in Claude Data
Get a checked weekly KPI dashboard spec with exact definitions, visible queries, week-over-week comparisons, RAG rules and a data checks panel, then the build.