;examples:csv: a YNAB 4 example, with workaround for RTL currency symbol
This commit is contained in:
parent
de9095792e
commit
717e86ff28
3
examples/csv/ynab4-rtl.csv
Normal file
3
examples/csv/ynab4-rtl.csv
Normal file
@ -0,0 +1,3 @@
|
||||
"Account","Flag","Check Number","Date","Payee","Category","Master Category","Sub Category","Memo","Outflow","Inflow","Cleared","Running Balance"
|
||||
"checking1",,,2022/11/07,"shop1",,,,"Lunch",د.ا.4.750,د.ا.0.000,C,د.ا.0.000
|
||||
"creditcard1",,,2022/12/11,"coffeeshop",,,,"Coffee",د.ا.93.210,د.ا.0.000,C,د.ا.56.790
|
||||
|
28
examples/csv/ynab4-rtl.csv.rules
Normal file
28
examples/csv/ynab4-rtl.csv.rules
Normal file
@ -0,0 +1,28 @@
|
||||
skip 1
|
||||
fields account, flag, check_number, date, payee, category, master_category, sub_category, memo, outflow, inflow, cleared, running_balance
|
||||
if %cleared C
|
||||
status *
|
||||
|
||||
description %payee | %memo
|
||||
account1 %account
|
||||
#account2 %category
|
||||
|
||||
# the RTL currency symbol breaks these somehow
|
||||
#amount-out %outflow
|
||||
#amount-in %inflow
|
||||
#balance1 %running_balance
|
||||
#currency د.ا.
|
||||
|
||||
# so extract the amounts with regex groups
|
||||
|
||||
if %inflow ([0-9]+\.[0-9]+)
|
||||
amount-in \1
|
||||
|
||||
if %outflow ([0-9]+\.[0-9]+)
|
||||
amount-out \1
|
||||
|
||||
if %running_balance ([0-9]+\.[0-9]+)
|
||||
balance1 \1
|
||||
|
||||
# and use the ISO-4217 code instead
|
||||
currency JOD
|
||||
Loading…
Reference in New Issue
Block a user