converting bank.csv files to homebank.csv standard (via definition-file)
[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 [,;]
[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,
Line contains 3 fields/columns (left to right):
[1] = (H) Homebank field !! field # = [H] >>> do NOT change <<<
[2] = Homebank name !! function >>> do NOT change <<<
[3] = (B) Skipped Bankfile header-lines !! [0…N] (skipped from the top)
*
Rest of lines informs program position of field-data stored in [“bank”.csv] file,
Line contains 5 fields/columns (left to right):
Column[3]
[-1] : "not-in-use" (negative number)
Bank-file contains header with data to be extracted
[-2..-N]: LAST-line of header (negative number) i.e. headerlength
[Without header]
Column[5]
These 3 fields are Homebank-date, -amount, -paymode.
-Date (any order): 4*[Y]ear,2*[M]onth,2*[D]ay -> seperation[-#%&*/] -> [YYYY/MM/DD] [YYYY-MM-DD] [DD%MM%YYYY]
*
-Amount (comes first): Amount without sign needs extra Amount_sign info,
Amount-format can have grouping-token[,.]
and decimal-token[.,]
limitations: integers[N*= any number], fraction[None .. 2= max]
-Amount_sign (second): [aA-zZ],[aA-zZ] -> order [+,-] -> [D,C] [Debet,Credit] [af,bij] [Neg,Pos]
*
-Paymode (any lenght): N*(Booking-code) , N*(Homebank-code)
[aA-zZ,0-9],..,[aA-zZ,0-9], [0-10],...,[0-10] -> [ga,gb,cb,..,tg,kh,db,3,3,4,..,8,9,10]
(any no. of char. per code)
[With header]
Column[5]
These fields are Homebank-account,-balance
Consists of row/line-number[1-N] and column/line-item-number[0-N].
Header: (line N of header) , (item N of line) Example
[2-N] , [0-N] -> [6,1]
H
#
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