Free-form paragraphs are hard to reuse. Ask for structure, and the output can go straight into Excel, a database or another program.
Tables for Excel
“Extract invoice number, date (dd-mm-yyyy), vendor, GSTIN and amount from the text below as a table.” Copy the table and paste into Excel; columns line up.
CSV
“…as CSV with a header row, comma-separated, amounts without commas.” Save as .csv or paste with Data › Text to Columns.
JSON with a schema
“`text
Return JSON only, no explanation, with exactly these keys:
{“invoice_no”: string, “date”: “YYYY-MM-DD”, “vendor”: string, “gstin”: string or null, “amount”: number}
If a value is missing, use null.
“`
Fixed keys, types and a rule for missing values make the output predictable. Many APIs also have a “structured output / JSON mode” that enforces the schema.
💡 Say how to handle missing or unclear data (null, “UNKNOWN”). Otherwise the model may invent a plausible GSTIN or date to fill the gap.
⚠️ Check extracted numbers against the source on a sample. Extraction is very good but not perfect, especially with scanned documents.
Practice
Try the three extraction formats with your own invoice or email text (remove anything confidential first).
📎 Practice files for this article
📄
Lesson 5 prompt worksheetCopy-paste prompts and exercises to try in ChatGPT, Copilot, Gemini or Claude.