For some reason I can’t see the other 13 comments, maybe they’re not public yet.
But I posted over on HN a possible Mt940 library:
If anyone finds themselves in a similar position, writing MT940 files — there’s at least one open source Java library for doing so. See http://api.prowidesoftware.com/core/com/prowidesoftware/swift/model/mt/mt9xx/MT940.html and its source at http://prowide.googlecode.com/svn/trunk/pw-swift-fields/src/com/prowidesoftware/swift/model/mt/mt9xx/MT940.java (LGPL) as well as further examples at https://github.com/prowide/prowide-core-examples
First time hearing about MT940 and SWIFT message format. As a Canadian, I’m used to seeing QBX/OBX/CSV as import/export formats (thanks to QuickBooks and Microsoft Money), and every accounting package I’ve worked with allows for CSV import though it’s not quite as nice about it.