-
|
I've been exploring prowide's open source library to convert MT940s to an JSON format. While the library does a great job when a standard MT940 formatted file is fed, it fails to handle files without header blocks namely 1,2,3. In other words, the files contain the message text block 4 (20, 25, 28C, 60F, 86, 62F, 64 records) directly. This is how our banking partner transfers the file and the SAP system seem to be capable of accepting this import. Is there anyway this library could handle such files? Please advise. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
A workaround would be to present your block 4 with dummy headers when calling the toJson. Then manipulate the JSON output to discard the part corresponding to the dummy headers. Notice you just need dummy block 1 and 2 since block 3 is already optional. https://dev.prowidesoftware.com/latest/open-source/core/mt-parser/#base64-block4-parsing Something like this should do the trick: Where |
Beta Was this translation helpful? Give feedback.
A workaround would be to present your block 4 with dummy headers when calling the toJson. Then manipulate the JSON output to discard the part corresponding to the dummy headers. Notice you just need dummy block 1 and 2 since block 3 is already optional.
https://dev.prowidesoftware.com/latest/open-source/core/mt-parser/#base64-block4-parsing
Something like this should do the trick:
Where
payloadis the plain block 4 text without boundaries