New Tool Radar

AI for Data & Spreadsheets

How to Check an AI-Extracted Table Row Count Against the PDF

Compare the row count of an AI-extracted table with the source PDF to catch rows the AI dropped or duplicated.

Schematic illustration for How to Check an AI-Extracted Table Row Count Against the PDF: three numbered steps - Count rows in the PDF; Count rows in the sheet; Find the missing row.

An extraction can look complete while missing the last row of a table, because nothing in the sheet says a row is absent. Counting the rows in the PDF and in the sheet, and then matching them one by one, is the fastest way to prove nothing was dropped or doubled.

Prerequisites

  • The source PDF
  • The extracted sheet
  • A copy of the source file, so the original stays untouched.

Steps

  1. Count the data rows in the PDF table by hand, ignoring the header row and any total row, and write the number down.
  2. Count the data rows in the sheet the same way, and compare the two numbers.
  3. If the counts differ, read the PDF rows in order against the sheet rows until the first mismatch appears.
  4. Check whether the missing row was merged into the row above it, or the extra row is a duplicated copy of another row.
  5. Add or remove the row from the source reading, then recount both sides until they agree.

Worked example: Fictional delivery note row count

The practice table below is a fictional five-item delivery note. The count column is 1 per delivered line, and the total is the number of lines. The table below is fictional practice material, with fictional values. It is the expected result, worked out by hand, not a run of any tool.

Item Count
Boxes of paper 1
Ink cartridges 1
Notebooks 1
Folders 1
Labels 1
Total 5

Expected result. Five rows in the PDF and five rows in the sheet, each item matched in order. UNTESTED: no AI extraction was run for this guide; the table shows the expected values a check should produce.

Limits

  • A total row in the PDF is not a data row, so count it separately or the counts will never agree.
  • A table split across two PDF pages is easy to undercount, so check the page break.

Sources

See all