Faster Fio parsing.

This commit is contained in:
Dominik Pantůček 2023-03-31 09:55:05 +02:00
parent 9435659140
commit 8fb302f682
2 changed files with 9 additions and 5 deletions

View file

@ -33,7 +33,7 @@
(import scheme
(chicken base)
(chicken irregex)
(chicken string)
bank-account
csv-simple
progress)
@ -44,9 +44,13 @@
(let ((id (string->number (car row)))
(date (cadr row))
(amount (string->number
(irregex-replace (irregex "," 'u)
(caddr row)
".")))
(let* ((astr (caddr row))
(ci (substring-index "," astr)))
(if ci
(string-append (substring astr 0 ci)
"."
(substring astr (add1 ci)))
astr))))
(currency (string->symbol (cadddr row)))
(varsym (list-ref row 9))
(message (list-ref row 12)))

View file

@ -55,7 +55,7 @@
(let* ((msg (bank-transaction-message transaction))
(ci (substring-index "," msg))
(vs (if ci
(substring msg ci)
(substring msg 0 ci)
msg)))
(string->number vs)))))
varsym-id))