profiler / HB_Convert

converting bank.csv files to homebank.csv standard (via definition-file)
16 stars 5 forks source link

Convert_1.3 Attempt creating a universal Homebank(4.3) csv import converter (c)Ton 8-10-2011

[Manual] Program usage

Before you can use this script, you have to create a definition-file (see short manual below) Format import-csv-file-record homebank = ['date','paymode','info','payee','description','amount','category'] Format import-csv-file-record bank = [any number of fields & field-position in record] Record field seperation-token can be comma or semicolon [,;]

Run in terminal, on command-line type ./Convert_x.x.x.py [import.csv] [output.csv] [import.def] [Leganda] [import.csv] = ("bank".csv) file exported from bank [output.csv] = ("homebank".csv) file to be created [import.def] = ("bank".def) definition-file "bank" <> "Homebank" Input-files: [import.csv], [import.def] Output-files: [output.csv], log.txt (= logging conversion process)

[Manual] Definition-file: Homebank definition file contains multiple lines/records: First line is needed to be able to SKIP Header-line(s) at the top of the ["bank".csv] file,

============================================================================================================= Example-definition-file 1 (without header):

H B <"Bank">

_________

0;date ;2 ;Curr.date ;YYYYMMDD 1;paymode ;8 ;Booking-Code ;ga,gb,cb,sb,tb,ba,ck,eb,ei,ma,nb,bg,ac,id,3,3,4,4,5,6,6,7,7,7,7,8,8,8 2;info ;5 ;Offset-account ; 3;payee ;6 ;Payee ; 4;description ;10;Description.1 ; 4;description ;11;Description.2 ; 4;description ;12;Description.3 ; 4;description ;13;Description.4 ; 4;description ;14;Description.5 ; 4;description ;15;Description.6 ; 5;amount ;4 ;Amount ; 5;amount_sign ;3 ;Debet/Credit ;D,C 6;category ;-1; ; 7;account ;0 ;Account ; 8;balance ;-1; ;

Example-definition-file 2 (with header 1 line to be skipped):

H B <"Bank">

_________

H;header ;1 0;date ;2 ;Curr.date ;YYYYMMDD 1;paymode ;8 ;Booking-Code ;ga,gb,cb,sb,tb,ba,ck,eb,ei,ma,nb,bg,ac,id,3,3,4,4,5,6,6,7,7,7,7,8,8,8 2;info ;5 ;Offset-account ; 3;payee ;6 ;Payee ; 4;description ;10;Description.1 ; 4;description ;11;Description.2 ; 4;description ;12;Description.3 ; 4;description ;13;Description.4 ; 4;description ;14;Description.5 ; 4;description ;15;Description.6 ; 5;amount ;4 ;Amount ; 5;amount_sign ;3 ;Debet/Credit ;D,C 6;category ;-1; ; 7;account ;0 ;Account ; 8;balance ;-1; ;

Example-definition-file 3 (with header containing data):

H B <"Bank">

________

0;date ;2 ;Curr.date ;YYYYMMDD 1;paymode ;8 ;Booking-Code ;ga,gb,cb,sb,tb,ba,ck,eb,ei,ma,nb,bg,ac,id,3,3,4,4,5,6,6,7,7,7,7,8,8,8 2;info ;5 ;Offset-account ; 3;payee ;6 ;Payee ; 4;description ;10;Description.1 ; 4;description ;11;Description.2 ; 4;description ;12;Description.3 ; 4;description ;13;Description.4 ; 4;description ;14;Description.5 ; 4;description ;15;Description.6 ; 5;amount ;4 ;Amount ; 5;amount_sign ;3 ;Debet/Credit ;D,C 6;category ;-1; ; 7;account ;-7;Account ;2,1 8;balance ;-7;Balance ;6,1