StmtRecon
MT940 fields and statement controls

Split multi-account MT940 files at account and message boundaries

A new statement identifies its account in :25:. Flat exports can separate statements with a hyphen line and FIN envelopes can close with -}. Reset the statement context before assigning the next movement.

Open this sample in Air-Gapped Converter

Worked bank sample

Synthetic bank data for local reconciliation.

:20:REPORT-1
:25:OPERATING
:28C:007/1
:60F:C261130EUR100,00
:61:2611301130C25,00NTRFINV-0042//BANK-841
:86:Operating account receipt
:62F:C261130EUR125,00
-
:20:REPORT-2
:25:RESERVE
:28C:008/1
:60F:C261130EUR300,00
:61:2611301130C25,00NTRFINV-0042//BANK-841
:86:Reserve account receipt
:62F:C261130EUR325,00

Field anatomy

Field or pathMeaning in this fileType or formatERP or Excel import risk
:25:Reporting account identifierAccount stringMatching only on :28C: merges separate accounts.
- / -}Flat separator / FIN text terminatorProfile-specific delimiterA hyphen attached to :62F: breaks the balance.

Root cause and ERP fix

  1. Account context leaked across a boundary. Read the next :25: before assigning movements.
  2. A hyphen in a reference was treated as a separator. Recognise only a complete delimiter line.
  3. A total balanced across two accounts. Test each account and currency separately.

Inspect with the MIT parser

Save the sample as mt940-account-switch-delimiters.sta and the script as inspect.mjs. With @stmtrecon/parser installed, run node inspect.mjs mt940-account-switch-delimiters.sta.

import { readFile } from 'node:fs/promises';
import { inspect } from '@stmtrecon/parser';
const text = await readFile(process.argv[2], 'utf8');
const blocks = text.replace(/\r/g, '').replace(/^-[ \t]*$/gm, '').trim().split(/(?=^:20:)/m);
const reports = blocks.map(block => inspect(block.trim(), { transactions: true }));
const accounts = blocks.map(block => block.match(/^:25:(.+)$/m)[1]);
console.table(reports.map((r, i) => [accounts[i], r.opening, r.closing]));
Open this sample in Air-Gapped Converter

Export 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

Related MT940 fields and statement controls

Export your full workbook

Purchases are currently unavailable. Existing licenses can be activated offline.