-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathREADME
136 lines (132 loc) · 7.79 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
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,
* 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):
*
[1] = (H) Homebank field pos. !! field # = [0..8] >>> do NOT change <<<
[2] = Homebank field name !! as in Homebank >>> do NOT change <<<
[3] = (B) Bankfile field pos. !! field # = [0..N,-1,-M] (M = headerlength)
[4] = Bankfile field name !! as in Bank-file
[5] = Bankfile field details !! line #,pos # (NO semicolons allowed)
-------------------------------------------------------------------------------------------------------------
Column[3] <Bankfile-field-number> [0..N] : existing field (possitiv number)
* [-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
*
NOTE: Multi definitions-lines(rows) per field are possible but cannot contain [-1] !!!!!!!!!!
NOTE: header containing data MUST be >= 2 lines !!!!!!!!
-------------------------------------------------------------------------------------------------------------
[Without header]
Column[5] <Bankfile-field-details> must contain information crucial for converting import field-data.
* 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)
*
NOTE: NO semicolons allowed in Bank-file-field-details !!!!!!!!!!
--------------------------------------------------------------------------------------------------------------
[With header]
Column[5] <Bankfile-field-details> must contain information crucial for converting import header-data.
* 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]
=============================================================================================================
Example-definition-file 1 (without header):
---------------------------------------------------------------------------------------------------------
H <Homebank> B <"Bank"> <Bank-file>
#___<field>___________<field>_______<field-details>______________________________________________________
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 <Homebank> B <"Bank"> <Bank-file>
#___<field>___________<field>_______<field-details>______________________________________________________
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 <Homebank> B <"Bank"> <Bank-file>
#___<field>___________<field>_______<field-details>_________________________________________
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