PromptOperations

Prompt: extract a PDF table without filling in what you can't read

Pull rows from a PDF with their page and line, keep unreadable cells empty and flagged, and report the printed total apart, so the gap stays visible before you import.

Works with: ChatGPT, Claude, Copilot, Gemini

The task

Prototype a PDF-to-spreadsheet extraction that keeps a trace of every row and never turns an unreadable cell into a guess.

Prompt
Treat these lines as a fictional PDF transcription. Extract detail rows
only, retaining SKU as text. Return JSON with rows containing sku,
quantity (integer or null), page, line and exact evidence. Quantity 0
is valid. [unreadable] becomes null with review_reason="unreadable".
Do not infer it from another row or the printed total.
Also return known_quantity_sum, incomplete_total and printed_total.
The printed total is a document claim, not an extracted detail row.

Page 1 line 4: SKU 0012 | quantity 3
Page 1 line 5: SKU 0048 | quantity 0
Page 2 line 2: SKU 0091 | quantity [unreadable]
Page 2 line 6: Printed total quantity: 8

How to use it

  1. Run it with the fictional transcription first.
  2. Then try a synthetic PDF in your approved extraction tool and compare every row with the page image.
  3. Check each null on the page itself before the spreadsheet import.

What you get

Three detail rows with SKUs kept as text (0012, 0048, 0091), quantities 3, 0 and null, a known sum of 3, the total marked incomplete, and the printed 8 reported apart.

Example answer we got
{
  "rows": [
    {"sku": "0012", "quantity": 3, "page": 1, "line": 4, "evidence": "SKU 0012 | quantity 3"},
    {"sku": "0048", "quantity": 0, "page": 1, "line": 5, "evidence": "SKU 0048 | quantity 0"},
    {"sku": "0091", "quantity": null, "page": 2, "line": 2, "evidence": "SKU 0091 | quantity [unreadable]", "review_reason": "unreadable"}
  ],
  "known_quantity_sum": 3,
  "incomplete_total": true,
  "printed_total": 8
}

SKU 0091's quantity is null and flagged for review. I didn't fill it in from the printed total. The total implies 5, but that number isn't on the row itself.

Where should you start with AI?

The free assessment gives you, in 4 minutes, the 3 tasks to automate first in your business.

Take the free assessment

Newsletter

The essentials of AI for small businesses, once a week

The week’s articles in 5 minutes, plus a prompt and a template to use right away. Free, no ads.