Extract payee from memo field

Timon Fiddike timon-kmymoney at fiddike.com
Mon Jan 15 19:44:34 UTC 2018


Hello everybody,

short version:

How does the "Extract payee from memo field" feature work?

You can find in here:
"Edit Account" > "Online Settings" > "Extract payee from memo field using regular expressions”

I can supply a screenshot if needed and sending those to the list is O.K.!?


TL;DR

I searched using Google, searched inside "The KMyMoney Handbook for KMyMoney version 4.8.1" and looked over the documentation of the QRegExp class http://doc.qt.io/archives/qt-4.8/qregexp.html#1
without success. Any RTFMs with pointers to specific documentation would be greatly appreciated.


Here's some background and transaction information and what I tried:

My KMyMoney version is 4.8.0, built on KDE Plattform 4.14.16 on Ubuntu 16.04.3, installed via this PPA https://launchpad.net/~michael-ruoss/+archive/ubuntu/kmymoney
I would have preferred 4.8.1, but I didn't find a PPA of 4.8.1 that was compiled with AqBanking support (if you know one, I'd be grateful for a hint).

I use KMyMoney with Aqbanking to download transaction data from my bank.
I rely on payees default category to achieve automatic category assignments.

This works perfectly for transfers and direct debit payments, because in these cases my bank (GLS) fills the the payee field correctly.

However, for debit card payements the payee information is included only in the memo field.

Therefore I would like to extract the payee information from the memo field.

I was very happy when I discovered "Edit Account" > "Online Settings" > "Extract payee from memo field using regular expressions”.

Here are some example transaction for all three types (2 work, 1 doesn’t):

### Direct debit (works correctly, payee field filled):
01/05/2018
Payee: Berliner Mieterverein e.V.
Mieterverein Beitrag bis 12/2018
EREF: 11704290B43060967
CREF: XW3000-DD2018-01-04-05.38.08.168352
MREF: 11704290
CRED: DE67ZZZ00000173654
BELADEBEXXX/DE85100500000073729000

### Transfer (works correctly, payee field filled):
Payee: Andreas Meier
BIC:WELADED1PMBIBAN:DE02160500001000748486Datum: 12.01.18 Zeit: 11:42UFT 0011991436 TAN 979262Tanzkurs Januar 2018
WELADED1PMB/DE02160500001000748452

### Debit card payment (payee field empty, payee is "EDEKA GOETZE", only included in memo field):
Kartenzahlung DebitkarteEDEKA GOETZE/BERLIN09.01.2018/17.49 girocard58069551/093613/ECTL/NPIN64051/4118553100/2/1220REF 864315/260050
EREF: 58069551093613090118174902
CREF: XW3000-DD2018-01-10-12.07.38.430455
MREF: 864315
CRED: DE37ZZZ00001651213
EDEKDEHHXXX/DE78200907004364716071

### Debit card payment (payee field empty, payee is "ALDI SAGT DANKE 20 047", only included in memo field):
Payee: 
Kartenzahlung DebitkarteALDI SAGT DANKE 20 047/Berlin09.01.2018/10.17 girocard54402607/565180/CICC/FPIN64051/4118553100/0/1220
EREF: 54402607565180090118101714
CREF: XW3000-DD2018-01-11-00.37.25.206760
MREF: 561442
CRED: DE03ZZZ00001606817
GENODEDDXXX/DE42300600100000135546

### Debit card payment (payee field empty, payee is "denns Biomarkt", only included in memo field):
Payee: 
Kartenzahlung Debitkartedenns Biomarkt/Berlin11.01.2018/09.45 girocard61440314/079189/CICC/FPIN64051/4118553100/2/1220REF OFFLINE
EREF: 61440314079189110118094513
CREF: XW3000-DD2018-01-12-11.56.10.332472
MREF: OFFLINE
CRED: DE22ZZZ00000151669
WELADEDDXXX/DE86300500000001052141


So if memo starts with "Kartenzahlung Debitkarte" I need all the following characters up to the first /

So I klick to "Edit Account" > "Online Settings" > "Extract payee from memo field using regular expressions”.

How are the fields 
"Regular Expression for Payee"
"Regular Expression for Memo"
intended to be used?

Not quite knowing what to expect I tried using regular expressions that would extract everything and then trim them down to just what I need. Using these expressions for both Payee and Memo did not have any effect:
(.*?)     
[\s\S]*

When I tried .* in both fields, the last transaction's memo was reduced to it’s last line:
"
WELADEDDXXX/DE86300500000001052141"

So there was some kind of effect. However, the payee field was still empty.

As mentioned above, I searched using Google, searched inside "The KMyMoney Handbook for KMyMoney version 4.8.1" and looked over the documentation of the QRegExp class http://doc.qt.io/archives/qt-4.8/qregexp.html#1
without success. 

The QRegExp class implements different variants of regexp, which one is used for payee extraction?

How are the two fields meant to be used?

Any RTFMs with pointers to specific documentation would be greatly appreciated.

Thank you!

Timon

--
http://fiddike.com



More information about the KMyMoney mailing list