Guide · 8 min read

How to Use Prompts to Extract Information from Messy Data

The Problem: Messy Unstructured Data

You have 100 support emails. Each has: issue, frustration level, what they need, product vs. user error. You want this in a spreadsheet. Manual: 8+ hours. AI approach: Write a prompt, feed emails to AI, get structured data. ~30 minutes.

The Workflow

Step 1: Create a clear extraction prompt — for each email extract: Issue (one sentence), Frustration (1-5), Need (one sentence), Category (product_bug / feature_request / user_error), Urgency (low/medium/high). Specify return format. Step 2: Test on one real email. Refine if needed. Step 3: Batch extract — one-by-one in ChatGPT (slow but free), or use API (Cursor script: read emails, send to Claude API, write CSV), or Zapier + Claude.

Accuracy

High (95%+): Clear, obvious extraction (e.g., sentiment, email address). Medium (80-90%): Requires some interpretation (main need, urgency). Lower (<80%): Deep understanding or contradictory info. For medium accuracy, sample 10%, verify, refine prompt if needed.

Cost-Benefit

Manual: 100 emails × 5 min = 8+ hours ($400-800). AI with code: 1 hour setup, 2 min run, ~$1 API. AI manual paste: 2-3 hours, $0-30. Even the slowest AI approach is faster and cheaper than manual.

Common Issues and Solutions

Inconsistent format — add to prompt: "Always format responses exactly like this: [SPECIFY FORMAT]." Irrelevant extraction — be more specific: "Extract ONLY [specific thing]. Ignore everything else." Missing context — add context to the prompt (e.g., "frustration_level should be lower if customer was already helped once").

The Downloadable Resource

We've created a Data Extraction Prompt & Automation Guide that includes: Extraction prompt templates by source type; Cursor script template for batch extraction; quality check checklist; cost calculator; 10 example prompts; troubleshooting guide.

Download it here: aiforbusiness.net/resources/data-extraction-guide

What's Next

You've learned to extract structured data. The next article, "Building a 'Second Brain' for Your Business Using Prompt Templates," covers creating a reusable prompt library.