I had my job four months ago. I had spent my time hiking around Hong Kong and coding a web version of a mobile app I had created called Girlfriend Plus. It wasn’t going great, the backend I created was way too complicated and I wasn’t really sure how to get people to use it. Another problem, the web version was a lot worse than the mobile version.
The mobile version sends you notifications and it runs 100% offline. The mobile version also had a better user interface. In the last four months Girlfriend Plus Web brought in about $6.
I was not succeeding as an entrepreneur.
One day I realized I had saved up a lot of money, but I didn’t really know how much I was spending. When I was working I got paid a lot, and my bank balance would go up every month. After leaving my job, my bank balance started going down every month. Bad.
I decided I wanted to download a CSV file with all my bank transactions in it, so that I could figure out how much I was spending a month. Then I could figure out how many months I could survive without making any money. In the business world this is called your runway.
If you’ve got $100,000 in the bank, and you spend $10,000 a month, you have ten months of runway.
I spent some time on HSBC’s internet banking site and realized all they could give me were PDF bank statements. I tried to copy and paste the data into a Google Sheets document but it didn’t work. I then thought
“Angus you are a computer programmer, program the computer to do this for you”
That was a good idea. I created a new Kotlin project in IntelliJ, the first class I wrote was called HorseTest.kt. This is because I am a good boy and I take part in a development process known as Test Driven Development. Some people are not a fan of this process.
The name of the test says “should be able to say good morning”, but the code said “Hi Angus”. It was all okay though, I wasn’t there to build an app that greeted me, I was there to build a Bank Statement Converter. I quickly discovered Apache PDFBox and it seemed to be a good thing to use for reading PDF files.
PDFBox contained a class called PDFTextStripper, it sounded pretty sexy so I tried it out. It was able to get text out of the PDF, which was pretty cool.
Pretty nice eh. However, sadly, it isn’t possible to get the text above into that shape.
This is because the x position of the text “3.84” tells you that it belongs to the “Deposit” column. I needed a rectangle with every piece of text. I could associate a piece of text with a column by seeing which heading it intersects with. The text “298.00” intersects with the column named “Withdrawal”, therefore “298.00” is a Withdrawal.
I poked around through the code of PDFBox and found a class called TextPosition.java it has properties for text, x, y, endX and endY. Basically it stores text and a rectangle telling you where on the page that text appears. Perfect.
I continued hacking on this for a few more days and came up with a cool algorithm that went something like this:
Note: In this world a word is not really a word. “CSL MOBILE LTD” is considered a word in Bank Statement Converter speak. Sometimes in programming we like to use words incorrectly. We do this because we are annoying.
This algorithm worked pretty well and I was feeling pumped. I started thinking
“Wait a minute, HSBC is the biggest bank in Hong Kong, if I need this tool, then surely there must be other HSBC customers who need this too? I should make this into a web application.”
At the last company I worked at I became friends with a really good front end developer who went by the name Dominic. The two of us would always talk about building apps. I would say “We should make an app”. Then Dom would say “Yeah man we should make an app”. Then we would sit in silence as we realised we had no idea what app to make.
Would Dom be interested in building the UI for this bank statement converting web app?
I’m a cool guy so I started the conversation off by telling Dom he didn’t need to worry about whatever nonsense was worrying him. In business this is called “Disregarding other people’s feelings”.
Post article|From Concept to Launch: The Birth of Bank Statement Converter [Journey in Coding] #2
Written by Angus Cheng (Link)
Original post : BankStatementConverter.com Chapter #1
0 Comments