MT940 Parser

Hello,

I have imported MT940 dep into my elixir project, however, when i read the file to have it parsed into more usable data, I get an error:

** (ArgumentError) argument error
(mt940) lib/parser.ex:63: MT940.Parser.parse!/1
(mt940) lib/customer_statement_message.ex:33: MT940.CustomerStatementMessage.parse!/1
(tool) lib/tool.ex:20: anonymous fn/2 in Tool.readFiles/0
(elixir) lib/enum.ex:1940: Enum."-reduce/3-lists^foldl/2-0-"/3
(tool) lib/tool.ex:15: Tool.readFiles/0

1 Like

From a first glance, some error occured while parsing the input data.

Either the input is broken or the parser library.

2 Likes

My input data looks like:

{1:F01BARCZMLXAXXX0000000000}{2:I940NOSWFT99XXXXN}{3:{108:BAFZMSWI1437951}}{4:
:20:BAFZMSWI1437951
:25:ZMB0011092349
:28C:00097/00001
:60F:C200522ZMW11002,20
:61:2005220522D11002,20NTFR000000000//050065073943001
ZRA ASY TAX
:86:CTPTY:ZAMBIA REVENUE AUTHORITY
REMIT:BAFZMSWI1437665
SERIAL:000000000
:62F:C200522ZMW0,00
:64:C200522ZMW0,00
:65:C200526ZMW0,00
:65:C200527ZMW0,00
-}

When i edit out the first line, the parse kind of works but breaks at some point.
Is there any other deps i can import to help with the task?

Reviewing this helped me find what the issue was,
Definitely the input is broken and the library works just fine.

2 Likes