MT940 import: swift header

Christian Bjerre Nielsen christian at
Wed Apr 9 00:19:43 EDT 2008


The SWIFT message standard defines header information in block 1 (the basic
header block), 2 (the application header block) and the optional block 3
(User header block). The message content is in block 4 (the text block),
which starts with the following sequence:


Block 5 the trailer block. 

The message content is enclosed from the second line until the "-}". So for
normal import operations you only this, i.e. skip the first line in the text
file with the SWIFT message.

Many banks and other SWIFT users only supply the text block to their users.

As long as  you do not need any information regarding routing, MAC, ... Then
you can safely skip the first line and any lines after the "-}".

So it's more a question of import only or verication of sender and then
import in GNUCASH.


-----Original Message-----
From: gnucash-devel-bounces at
[mailto:gnucash-devel-bounces at] On Behalf Of Martin Preuss
Sent: 8. april 2008 22:18
To: gnucash-devel at
Subject: Re: MT940 import: swift header


On Dienstag, 8. April 2008, Damien Perritaz wrote:
> different banks. one file (A) is well imported and the other (B) not. 
> i have noticed the difference between the two files. file A has no 
> swift header and begins directly with ":20:". file B has a swift 
> header in the same format as described in different places

Normally AqBanking accepts the SWIFT header (since YellowNet uses them,

Could you maybe send me one of your files in question?

"Things are only impossible until they're not"

Martin Preuss - AqBanking - LibChipcard -
gnucash-devel mailing list
gnucash-devel at

More information about the gnucash-devel mailing list