These scripts takes the so-called "CSV export" files generated by some internet banking websites into a proper CSV file format ready to import into popular personal finance software applications. The problem is that the files that these banks generates seems to be intended for use in spreadsheet applications and not to import to other databases. However many personal finance software expects CSV formats in which every line contains a transaction, except for the first line which may be a header.
In consequence you will need to convert your bank's dump into the file format expected by your personal finance application whenever you are reconciling your accounts.
I am no longer maintaining these scripts. These kept breaking with new releases of R
, lubridate
, or and various other dependencies to the point that I've moved away from R
for my monthly financial reconciliation workflow.
I've re-written most of these scripts to Python and made it available as BankConverter2. Those scripts has been stable thus far.
Currently these banks and account types are supported:
- DBS Bank Ltd Savings.
- Oversea-Chinese Banking Corporation (OCBC) 360 (savings account) and Frank (credit card account).
- Bank Central Asia (BCA) Transaction history CSV.
DBS' CSV export file has a header with plenty of blank lines, not sure how they got there. Furthermore the CSV record header is followed by a blank line before the data comes in. I'm not sure what were they thinking when they designed this format.
OCBC 360's export file also contains non-columnar header lines but without much superfluous blank lines. However in a transaction may consists of two lines – depending whether it contains an extra free-form text. However not all transactions comes in two lines, hence we can't assume in that every even line contains the free-form text.
The credit card account of OCBC contains yet another slightly different format. The first column may denote a foreign currency transaction and if this is the case, the amount column moves to that row and shifted one column to the left.
You will need to have R version 3.1.2 (or newer) installed in your system as well as these R packages:
dplyr
lubridate
Please consult R's documentation how to install these.
These installation steps should work on Unix or Unix-like systems (e.g. macOS, Linux, or BSD).
-
Download the repository
-
Mark the scripts as executable:
$ chmod a+x csv-dbs.R csv-ocbc.R csv-ocbc-frank.R
-
Create a symbolic link from
/usr/local/bin
to the script's installation directory:$ cd /usr/local/bin $ ln -s {path-to-download}/csv-dbs.R csv-dbs $ ln -s {path-to-download}/csv-ocbc.R csv-ocbc $ ln -s {path-to-download}/csv-ocbc-frank.R csv-ocbc-frank $ ln -s {path-to-download}/csv-bca.R csv-bca
If you are a Windows user, please adapt those steps to your system as necessary.
- Open your bank's Internet Banking website and download your transaction history into a CSV file.
- Run the conversion script against it, either
csv-dbs
,csv-ocbc
,csv-ocbc-frank
orcsv-bca
- The first argument is your bank's CSV file as input.
- The second argument is where to write the processed CSV output.
- Import the resulting CSV output into your favorite personal finance software.
These scripts are provided under the BSD 2-clause open source license. Please refer to file LICENSE.md
for details.
I have been having this CSV conversion problem for a long time and have been solving it manually so far – that is, clean up the data manually using a text editor and a spreadsheet. I even wrote a blog post on the topic and see whether it would be worth to write an app around the issue. Apparently there was not much interest, hence I wrote these scripts just to solve my own problem. Please let us know if I was wrong and it's worth your time and money to have an easy-to-use app or service to do this.
Sasmito Adibowo
http://cutecoder.org