I'm afraid your solution fails when the separator occurs in the field value as is allowed by the specs. E.g.
'/TRTP/SEPA OVERBOEKING/IBAN/CH999999999999F/BIC/UBSWCHZH80A/NAME/ORIG/INAL ART/REMI/CH9999999999/EREF/NOTPROVIDED/O\ RDP//ID/UBS AG'
Comes out as
{'ORIG//REMI': 'CH9999999999', 'NAME': '', 'BIC': 'UBSWCHZH80A', 'TRTP': 'SEPA OVERBOEKING', 'EREF': 'NOTPROVIDED', 'ORDP//ID': 'UBS AG', 'IBAN': 'CH999999999999F'}
when using your test script.
« Back to merge proposal
I'm afraid your solution fails when the separator occurs in the field value as is allowed by the specs. E.g.
'/TRTP/SEPA OVERBOEKING/ IBAN/CH99999999 9999F/BIC/ UBSWCHZH80A/ NAME/ORIG/ INAL ART/REMI/ CH9999999999/ EREF/NOTPROVIDE D/O\
RDP//ID/UBS AG'
Comes out as
{'ORIG//REMI': 'CH9999999999', 'NAME': '', 'BIC': 'UBSWCHZH80A', 'TRTP': 'SEPA OVERBOEKING', 'EREF': 'NOTPROVIDED', 'ORDP//ID': 'UBS AG', 'IBAN': 'CH999999999999F'}
when using your test script.