Extract the tables from an invoice to Excel
Line items, quantities and amounts, lifted off the page into a spreadsheet you can total. The invoice is recognised first, because most of them arrive as a photograph or a scan.
- The grid is rebuilt from where the words sit, not from spaces.
- Figures are written as numbers, so the column totals.
- Nothing is uploaded, which matters for a supplier price list.
Why most converters lose the table
Read an invoice as plain text and a row comes out as one line: the description, the quantity and the amount separated by spaces, with no way to tell which space was a column boundary. That is unrecoverable afterwards, and it is what almost every quick conversion produces.
The grid here is found from the geometry instead: where the words sit on the page, where the white space runs down the page, and which rows line up with which. That handles the shapes a real invoice uses, including a two-deck header, a merged cell spanning two columns, and a description that wraps onto a second line without starting a new row.
A header band that is set in the same face and size as the rest gives a recogniser nothing to go on, so it is found a third way: labels standing over columns of figures is what a header row actually is. A number anywhere in the first row settles it the other way, because a line reading Item 2 names nothing.
What lands in the spreadsheet
Anything shaped like a number is written as one, including Indian grouping. A leading zero, a long unbroken run of digits, a date, a percentage and anything carrying a letter stay as text, because a purchase order number read as a number is worse than one left alone.
Check the figures against the invoice before you pay anything from the spreadsheet. A recogniser reading a photograph is confident about digits it has got wrong, and a long reference number is exactly where one goes missing without any sign that it has.
Can I do a folder of invoices at once?
Add them all and the plan runs over each in turn. Each one becomes a sheet you can save.
What if the invoice has no ruled lines?
Ruled lines are not used. The columns are found from the white space between the words, which is why an unruled invoice works.
Support and billing: support@gosmartpdf.com. Operated by Mrityunjay Kumar, India. Payments by Dodo Payments, our merchant of record.
Loading the editor…