Difference between revisions of "CSV Import (MasterCard)"

From GnuCash
Jump to: navigation, search
(Feature requests)
(Usage)
Line 10: Line 10:
 
1. Simply download mastercard2ofx:
 
1. Simply download mastercard2ofx:
 
   wget <nowiki>http://members.inode.at/martin.klaffenboeck/scripts/mastercard2ofx</nowiki>
 
   wget <nowiki>http://members.inode.at/martin.klaffenboeck/scripts/mastercard2ofx</nowiki>
 +
'''Remark''' This address appears to be broken (404). Hopefully the source still exists somewhere else.
 +
 
2. Download your csv file from 'Umsatzabfrage' or maybe an english one.  'Umsatzabfrage' is something like 'request for transactions'.  Its iportant to name your csv file with the number of your credit card.
 
2. Download your csv file from 'Umsatzabfrage' or maybe an english one.  'Umsatzabfrage' is something like 'request for transactions'.  Its iportant to name your csv file with the number of your credit card.
 
The cvs file does not contain this inside, and the script takes it from the name.  So your save as filename looks like:
 
The cvs file does not contain this inside, and the script takes it from the name.  So your save as filename looks like:

Revision as of 02:26, 3 October 2009

Import MasterCard Transactions

I could import from every bank account, but couln't from my MasterCard account, because GnuCash does not support csv import.

Importing from csv is difficlult, because csv does not contain all informations gnucash needs, and every csv file is different from the other.

So I wrote a cvs2ofx converter for my MasterCard. It can handle csv files, downloaded via the https://umsatzabfrage.mastercard.at/Umsatzabfrage/ portal.

Usage

1. Simply download mastercard2ofx:

 wget http://members.inode.at/martin.klaffenboeck/scripts/mastercard2ofx

Remark This address appears to be broken (404). Hopefully the source still exists somewhere else.

2. Download your csv file from 'Umsatzabfrage' or maybe an english one. 'Umsatzabfrage' is something like 'request for transactions'. Its iportant to name your csv file with the number of your credit card. The cvs file does not contain this inside, and the script takes it from the name. So your save as filename looks like:

 1234567812345678.csv

3. Convert the csv file (the outfile can have any name, because the card number is saved inside:

 ./mastercard2ofx 1234567812345678.csv outfile.ofx

Now you can import this file via gnucash's ofx import.

Adjusting mastercard2ofx

If you want to support it your csv file, and this script doesn't handle it, it is easy for any python programmer to change it. Just look inside the file, there is a class called 'csv' with a method called 'next'. The next method reads the next line of the csv file, the 'rawval' is the raw valued list of the csv file. So it can be indexed with the number of the position in the csv file you have for your data (starting with 0).

- Martin <martin.klaffenboeck@gmx.at>

Other banks

http://iki.fi/lindi/darcs/gnucash/sampo2ofx is a slightly modified version that can read www.sampopankki.fi CSV format.

- Timo Lindfors <timo.lindfors@iki.fi>