Distinguish structured and free-text MT940 remittance
Field :86: can carry numbered subfields or an unstructured explanation in the same delivery. Classify each transaction before extracting an invoice reference and retain unmatched text for review.
Open this sample in Air-Gapped ConverterWorked bank sample
Synthetic bank data for local reconciliation.
:20:REPORT-1
:25:EUR-OPERATING
:28C:007/1
:60F:C261130EUR100,00
:61:2611301130C25,00NTRFINV-0042//BANK-841
:86:166?00TRANSFER?20INV-042
:61:261130C25,00NTRFJOB-18//BANK-842
:86:Goods for lot ?20 quoted by supplier
:62F:C261130EUR150,00Field anatomy
| Field or path | Meaning in this file | Type or format | ERP or Excel import risk |
|---|---|---|---|
| :86: prefix | Structured profile indicator | Three digits plus delimiter and field number | A literal ?20 in prose triggers a false match. |
| :61: → :86: | Owner of narrative | Adjacent tags | File-wide classification applies one dialect to every row. |
Root cause and ERP fix
- A question mark appears inside prose. Require the structural prefix before splitting.
- A reporting option changed mid-period. Classify each entry and review the unmatched population.
- Free text vanished when extraction returned no subfields. Carry the complete narrative into the exception worksheet.
Inspect with the MIT parser
Save the sample as mt940-structured-versus-free-text.sta and the script as inspect.mjs. With @stmtrecon/parser installed, run node inspect.mjs mt940-structured-versus-free-text.sta.
import { readFile } from 'node:fs/promises';
import { inspect } from '@stmtrecon/parser';
const text = await readFile(process.argv[2], 'utf8');
const report = inspect(text, { transactions: true });
const rows = report.transactions;
for (const tx of rows) {
console.log(/^\d{3}\?\d{2}/.test(tx.narrative) ? tx.subfields : tx.narrative);
}Open this sample in Air-Gapped ConverterExport a multi-sheet Excel workbook with balance checks and batch reconciliation on your device. No Node installation or cloud upload is required.
npm package · SDK source · Format reference