← All posts

Parsing

Reading tables with merged cells

Bank statements love merged cells. We stopped guessing column spans and started reading the ruling lines first.

·

5 min read

A merged cell breaks the simplest idea of a table: that every row has the same columns. Bank statements merge a date across three transactions, or a description across two columns, and a naive reader shifts every value after it by one.

Lines before text

Since r2.5 we find the ruling lines and whitespace gutters before reading any text. The grid they describe tells us which cells span which columns, so a merged date is copied down to the rows it covers instead of being dropped.

When there are no lines

Some statements draw no rules at all. There we align on the right edge of number columns, which stays fixed even when descriptions wrap. If neither signal is strong, the table goes to review with its evidence boxes rather than coming back wrong.

What you get back

  • Each row as an object keyed by your schema’s column names.

  • A confidence on every cell, not only on the row.

  • Evidence that says when a value was copied down from a merged cell.

A reviewer who opens a row sees why each value is there.