- jGnash CSV Import Plugin
jGnash CSV Import Plugin
It does not matter if you want to start a travel around the world or want to buy a digital SLR - comparing your income and your expenses help you to find out, how much money you save every month and if there is anything you don't need periodically to save more money. The comparison also visualizes your assets and can motivate you to reach your goals earlier. In former times a book of household accounts was used, now many applications are offered to support you.
One of these applications is jGnash. After a short overview I want to introduce a plugin for jGnash I developed. It enables you to import CSV (comma separated values) files into jGnash. Since these files are often generated by online banking software, it helps you to avoid failures and reduces the effort for entering the transactions enormous.
jGnash is an open source Java application for tracking and managing your financial transactions. You can download it at
- http://sourceforge.net/projects/jgnash/ - here you get the binaries. With these files you can start the application immediately.
- https://github.com/tsachev/jgnash - here you can view and download the source code.
For starting jGnash you need just Java 1.7 or higher. The attached manual shows you the steps for the installation and gives you an overview about the handling of the application. Therefore I don't want to go into further details about using jGnash itself.
But the principles of the the double entry bookkeeping in general needs getting used to.
"Double-entry bookkeeping, in accounting, is a system of bookkeeping so named because every entry to an account requires a corresponding and opposite entry to a different account. For instance, recording earnings of $100 would require making two entries: a debit entry of $100 to an account called Cash and a credit entry to an account called Income."
At the beginning it sounds a little bit difficult, but jGnash supports you with placeholder-accounts and intuitive dialogs very well. The most important step at the beginning is to think about the accounts and account-groups you need in the future. jGnash provides a couple of examples, how that could look like.
jGnash CSV Import Plugin
My online banking account offers an export of all transactions. It creates a CSV (comma separated values) file which I can download. Every line represents a transaction and contains the date, the amount, a description and so on. The values are separated by a semicolon.
The CSV Import Plugin offers a dialog for importing such files into jGnash. This saves a lot of time and avoids spelling mistakes in comparison to transcribe the account statement.
- Be sure you have installed Java 7.0 or higher. You can check it with the command java -version.
- Download the zip-file which contains the plugin and Guava.
- Unzip both files in the zip-file into the following directories:
- csvimport-1.0.jar/csvimport-2.0.jar into the directory plugins
- guava-18.0.jar into the directory lib
- Restart jGnash if it is already started
If the entry File > Import > CSV... does not exist in the menu, please use the version 2 of the plugin. In the jGnash version 2.26 the interface for plugins has been changed. Therefore I had to adapt the plugin as well.
Preparation of the csv-file
First create a csv-file with the bookings in your online banking application. Every booking must be represented by a line in the file. The columns must contain the date, the amount and a short note about the booking. The plugin supports two kinds of csv-files:
1. The first line in the csv-file contains the headlines of the columns. The following headlines must exist in the first line:
- Date (date when the booking was done)
- Amount (the amount of money; if it is a debit, the number must be negative)
- Memo (a short note about the booking)
The following example shows the content of a csv-file:
"Meat and vegetables";13/06/15;-41,48;EUR;
2. You don't need the headlines in the first line, but the 3 needed columns (date, amount, memo) must be in a special order:
- 2nd column: memo
- 3rd column: date
- 4th column: amount
This is an example without the column headlines:
15/06/2015;"Drilling machine";13/06/15;-110,00;EUR;13/06/2015 07:15:13:145;
15/06/2015;"Meat and vegetables";13/06/15;-41,48;EUR;13/06/2015 11:56:20:694;
15/06/2015;"Mobile phone";14/06/15;-25,31;EUR;14/06/2015 09:43:03:527;
Please consider the following points:
- Use always a semicolon for separate the columns. The last character of a line does not need to be a semicolon.
- Quotes at the beginning and the end of a text are ignored
- Please consider your country settings of your operating system when you enter the date and the amount. In Austria/Germany we usually use a comma and no point and dates look like 20.01.2015. In the USA or England usually points are used and dates look like 20/01/15. If you don't know your settings, just try different formats. If something cannot be parsed, it won't be shown in the import wizard.
- The column currency is ignored. Usually the default currency which you chose during the initialization of jGnash, is used.
If you like jGnash and the CSV Import Plugin, feel free to share this page! It is for free and I am glad to make life easier with this little plugin.