A Bank of America checking statement opens with an Account summary — beginning balance, deposits and other additions, withdrawals and other subtractions, checks, service fees, ending balance — then splits the month into those same named blocks, each closing with its own Total line. Transaction rows are just Date, Description and Amount, with debits already carrying a minus sign, so direction is not the problem here. Structure is. Checks are printed as a two-up side-by-side table of Date, Check # and Amount repeated across the page width, and scanned images of the cheques themselves occupy entire later pages as pictures with no text underneath them at all.
- Per-section Total lines are read as totals, not swept into the CSV as extra transactions.
- The two-up Checks table is read column-pair by column-pair, so cheques are not interleaved into the wrong order or merged into one run.
- Full-page check images are recognised as images — pages with no text layer fall back to OCR rather than silently extracting as blank.
- The Account summary block verifies the output category by category, so a dropped row surfaces as a DISCREPANCY instead of passing quietly.