Skip to main content
3 of 3
Commonmark migration

I had the same problem - Belgium's ING Bank now provides statements only as format pdf, with layout ± exactly as described in the post.

I tried 4 or 5 Open Source text extractors. The best was GhostScript - with thanks to this posting on stackoverflow;

GhostScript is the only O.S. extractor that I have found that renders lines as on page. (pdftotext and friends tend to break lines half way along.)

Then a little Perl script parsed the extracted txt into csv without problems. The columns in that final csv are Date;Balance;AMOUNT;text field1;text field2; ...

Dates are easy to spot with a regex qr(\d\d-\d\d\20\d\d).

The line «DATE SUBJECT AMOUNT» is also easy to spot with a regex that matches «+99.999,00» or «-1,23» (european way of writing numbers) at end of line.

The weird multiline format is rendered into csv as

  • weird line 1 in column text field 1,

  • weird line 2 in column text field 2,

  • etc.

I dont use that information very much so have not tried to mend any extraneous line breaks that there may be in the original.

One useful tip - in developing the Perl, add an extra column of "my calculation of the balance" and check that it always equals what the bank statement gives as the balance.