Difference between revisions of "CSV Import (MasterCard)"

From GnuCash
Jump to: navigation, search
m (MasterCard moved to CSV Import (MasterCard))
 
(7 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
[[Category:CSV]]
 +
General CSV import/export issues are addressed in a [[CSV Import/Export|separate wiki page]].
 +
 
== Import MasterCard Transactions ==
 
== Import MasterCard Transactions ==
  
I could import from every bank account, but couln't from my MasterCard account, because GnuCash does not support csv import.
+
I could import from every bank account, but couldn'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.
+
Importing from CSV is difficult, 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.
+
So I wrote a cvs2ofx converter for my MasterCard.  It can handle CSV files, downloaded via the https://umsatzabfrage.mastercard.at/Umsatzabfrage/ portal.
  
 
==Usage==
 
==Usage==
 
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>
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.
+
'''Remark''' This address appears to be broken (404). Hopefully the source still exists somewhere else.
The cvs file does not contain this inside, and the script takes it from the name.  So your save as filename looks like:
+
 
 +
2. Download your CSV file from 'Umsatzabfrage' or maybe an English one.  'Umsatzabfrage' is something like 'request for transactions'.  Its important to name your CSV file with the number of your credit card.
 +
The CSV file does not contain this inside, and the script takes it from the name.  So your save as file name looks like:
 
   1234567812345678.csv
 
   1234567812345678.csv
3. Convert the csv file (the outfile can have any name, because the card number is saved inside:
+
3. Convert the CSV file (the outfile can have any name, because the card number is saved inside:
 
   ./mastercard2ofx 1234567812345678.csv outfile.ofx
 
   ./mastercard2ofx 1234567812345678.csv outfile.ofx
  
Now you can import this file via gnucash's ofx import.
+
Now you can import this file via GnuCash's OFX import.
  
==Feature requests==
+
==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.  If you want me to do it, send me your csv file - I will to it for free (if I dont have to do to many other things).
+
If you want to support 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>
 
- 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>

Latest revision as of 19:52, 8 November 2021

General CSV import/export issues are addressed in a separate wiki page.

Import MasterCard Transactions

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

Importing from CSV is difficult, 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 important to name your CSV file with the number of your credit card. The CSV file does not contain this inside, and the script takes it from the name. So your save as file name 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 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>