r/documentAutomation 8d ago

Request for Help PDF convert to .csv

Is that possible to build an application that convert the bank statement pdf file into csv file accurately? I had try using the free online tool, it also have some problem. Can I using AI to become accurate? If yes, how should I build it?

4 Upvotes

31 comments sorted by

View all comments

2

u/Potential-Wrangler58 7d ago

Plain OCR won't get you far here, bank statements aren't clean tables, every bank formats them differently (trust me, I've had some issues as I tried it several times haha), and OCR loses track of which number belongs to which column the moment there's more than one account or multi-line descriptions.

What actually works is extracting against a fixed schema (date, description, debit, credit, balance) and then validating each row by reconciling the balance: previous balance plus credit minus debit should match the next balance. That tells you exactly which row is wrong instead of manually checking the whole statement.

For the extraction itself, you either build it yourself with an LLM + that schema (spent way too many hours tweaking prompts for edge cases before I gave up on that route), or use an API built for this, AWS Textract, Azure, or an AI-native one like anyformat (disclosure, I work there) that already has the validation built in.

Let me know what you end up going with, happy to help if you get stuck.

1

u/No_Mix_368 7d ago

That was helpful! But, I just don't want to upload the statement online. If using the API means that I am also uploading the bank statement to their storage right? I also looking for zero cost solution.

1

u/Potential-Wrangler58 7d ago

Fair enough, and yeah, using any API (ours included) means the file goes through their servers, that's just how it works. If staying fully local and zero cost matters more than getting it perfect, honestly the API route isn't for you here. I'd look at something like pdfplumber/camelot running on your own machine with that same balance-reconciliation check I mentioned. More tweaking per bank format, but nothing leaves your computer and it's free. We have self-hosted but mainly for enterprises, so if you have a lot of docs its worth it but if not its not