New Tool Radar

AI PDF

How to Verify the Totals and Row Counts of a Table Extracted From a PDF

Re-add the numbers in an extracted table, compare the totals and row count with the PDF, and fix any mismatch.

Schematic with three steps: Count the rows; Re-add the numeric columns; Fix the mismatches.

An extracted table can look complete while silently dropping a row or misreading a digit, and the error only shows up when the numbers are used. Re-adding the extracted column and comparing the total and the row count with the PDF catches both kinds of error in one check.

What you need

  • A CSV exported from a PDF table
  • The source PDF open at the table
  • A spreadsheet app that can sum a column

Step 1: Count the rows

Count the data rows in the CSV and in the PDF table, excluding the header row, and confirm the counts match.

Step 2: Re-add the numeric columns

Sum each numeric column in the spreadsheet and compare the sums with the totals printed in the PDF table.

Step 3: Fix the mismatches

For any row count or total that differs, find the row in the PDF, correct the CSV cell, and re-add the column until the totals agree.

Worked example: synthetic totals check on an extracted expenses table

The table below is a synthetic example. It shows the expected result of verifying extracted totals; no table was extracted.

Check PDF table CSV export
Data rows 15 15
Column total 8,420 8,420
Largest value 1,150 1,150
Missing rows 0 0

Expected result (UNTESTED). the CSV holds 15 data rows, the column total is 8,420 in both the PDF and the CSV, and the largest value matches. The extracted table is safe to use. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • A matching total does not prove every row is right; two errors can cancel each other out.
  • Check the row count first: a dropped row is the most common extraction error.
  • Merged cells and multi-line rows are the cases Tabula handles worst; check those rows by hand.

Sources

See all