How to preserve an empty middle cell in an extracted PDF table
3 November 2026
Keep a place for every column, even when a cell contains no text. If a four-column row is reduced to three values, the last figure can move under the wrong heading and still look like a perfectly reasonable number. Preserve the visible blank, identify the source position and decide separately whether your business process can accept an incomplete row.
Reconstruct the row before interpreting its numbers
Consider a fictional table with columns for item, quantity, unit price and amount. On the source page, line X17 contains item X17, quantity 2, an empty unit-price cell and amount 25.00. The rightmost amount must stay under Amount. An export such as the following preserves the distinction.
| Item | Quantity | Unit price | Amount |
|---|---|---|---|
| X17 | 2 | Blank in source | 25.00 |
In a structured export, a defined empty value such as JSON null can occupy the third slot. In a review sheet, add a status explaining whether the source is visibly blank, unreadable or still uninspected. Those conditions may all produce an empty value, but they need different follow-up. None authorises filling the unit price with zero.
The first-party raw extraction contains another kind of blank: a merged heading labelled Region B followed by three null entries. This is a heading row, not an item with three missing charges. The reference table also provides positive controls such as A01, with quantity 2, unit price 12.50 and amount 25.00. The blank unit-price example above is a separate exercise. Raw extraction results · Ground truth
Run two row checks before trusting a table total
- Check position against the page. Locate X17 by its row identity. Confirm that the rightmost 25.00 sits under Amount in the source, and verify the output retains all four columns. If the extractor delivers three values, put the row into review instead of padding a guessed position.
- Check whether the arithmetic is testable. For A01, two multiplied by 12.50 gives 25.00. For X17, the unit price is unknown. Record “cannot calculate from source fields”. A program multiplying a blank cannot establish a mismatch or prove an amount correct.
A downstream report might add all the valid amount cells and produce a plausible total while still putting the X17 value in the wrong field elsewhere. Retain the raw row and a page locator. Have a reviewer confirm the two column headings, restore the amount to its proper position and leave the missing price open. If a later source supplies it, record that source and version before recalculating.
Part of the How to catch wrong cells in a PDF table with the right total guide.
Preserve column meaning in PDF-to-CSV output
This section answers a narrower question than the rest of this page, and it does not mint a new URL. The original contribution preserved here is a table ground-truth dataset with cell and structure error checks.
Write the table you expect before you look at the output.
| Cell or relationship | Ground truth you wrote | What the output says | Same meaning? |
|---|---|---|---|
| One header and one value | Your fixture | The extract | Not run |
| An empty cell, a rotated region, or a column you marked | Your fixture | The extract | Not run |
Do not let a fluent table bless a shifted column.
The rest of this page remains the parent decision. Use the table for the question in the heading, and leave a cell blank rather than filling it from memory.
Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with NotebookLM. Source checks and editing by Kairos (Codex).
