Hello,
I have parsed an MT940 file that returns the list of structs as shown below.
I dont need all the structs returned and certainly not the first struct.
1.How can i access these structs in the list returned without having to use the syntax
[variable = %name{} = _head | _rest ] = list just to get to those structs i want.
2. Please note,the structs %MT940.Statementline{} and %MT940.StatementlineInformation{} repeat as many times depending on the :61: tag occurrences in the original mt940 file.
[
[
%MT940.Job{
content: "BAFZMSWI1434872",
modifier: nil,
reference: "BAFZMSWI1434872"
},
%MT940.Account{
account_currency: nil,
account_number: "ZMB0X1XXXXX",
bank_code: nil,
content: "ZMB0X1XXXXX",
modifier: nil
},
%MT940.Statement{
content: "00092/00006",
modifier: "C",
number: 92,
sheet: 6
},
%MT940.AccountBalance{
amount: #Decimal<27505.50>,
balance_type: :intermediate,
content: "C200515ZMW27505,50",
currency: "ZMW",
date: ~N[2020-05-15 00:00:00],
modifier: "M",
sign: :credit
},
%MT940.StatementLine{
amount: #Decimal<500.10>,
content: "2005150515C500,10NMSC000000014//0500650601140021004029630/CHD/",
entry_date: ~N[2020-05-15 00:00:00],
funds_code: :credit,
modifier: nil,
reference: "000000014",
swift_code: "NMSC",
transaction_description: "0500650601140021004029630/CHD/",
value_date: ~N[2020-05-15 00:00:00]
},
%MT940.StatementLineInformation{
account_holder: [],
account_number: nil,
bank_code: nil,
code: nil,
content: "CTPTY: REVENUE AUTHORITY REMIT:1004029630/CHD/2020/C/7833SERIAL:000000014",
details: ["CTPTY:REVENUE AUTHORITY REMIT:1004029630/CHD/2020/C/7833SERIAL:000000014"],
modifier: nil,
not_implemented_fields: [],
prima_nota: nil,
text_key_extension: nil,
transaction_description: nil
},
%MT940.StatementLine{
amount: #Decimal<500.10>,
content: "2005150515C500,10NMSC000000015//0500650601150021004029630/CHD/",
entry_date: ~N[2020-05-15 00:00:00],
funds_code: :credit,
modifier: nil,
reference: "000000015",
swift_code: "NMSC",
transaction_description: "0500650601150021004029630/CHD/",
value_date: ~N[2020-05-15 00:00:00]
},
%MT940.StatementLineInformation{
account_holder: [],
account_number: nil,
bank_code: nil,
code: nil,
content: "CTPTY: REVENUE AUTHORITY REMIT:1004029630/CHD/2020/C/7834SERIAL:000000015",
details: ["CTPTY:REVENUE AUTHORITY REMIT:1004029630/CHD/2020/C/7834SERIAL:000000015"],
modifier: nil,
not_implemented_fields: [],
prima_nota: nil,
text_key_extension: nil,
transaction_description: nil
},
%MT940.StatementLine{
amount: #Decimal<500.10>,
content: "2005150515C500,10NMSC000000016//0500650601160021001716173/KZU/",
entry_date: ~N[2020-05-15 00:00:00],
funds_code: :credit,
modifier: nil,
reference: "000000016",
swift_code: "NMSC",
transaction_description: "0500650601160021001716173/KZU/",
value_date: ~N[2020-05-15 00:00:00]
},
%MT940.StatementLineInformation{
account_holder: [],
account_number: nil,
bank_code: nil,
code: nil,
content: "CTPTY: REVENUE AUTHORITY REMIT:1001716173/KZU/2020/C/7926SERIAL:000000016",
details: ["CTPTY:REVENUE AUTHORITY REMIT:1001716173/KZU/2020/C/7926SERIAL:000000016"],
modifier: nil,
not_implemented_fields: [],
prima_nota: nil,
text_key_extension: nil,
transaction_description: nil
},
%MT940.StatementLine{
amount: #Decimal<4000.80>,
content: "2005150515D4000,80NTFR000000000//050065041377001 ASYCUDA TAX",
entry_date: ~N[2020-05-15 00:00:00],
funds_code: :debit,
modifier: nil,
reference: "000000000",
swift_code: "NTFR",
transaction_description: "050065041377001ASYCUDA TAX",
value_date: ~N[2020-05-15 00:00:00]
},
%MT940.StatementLineInformation{
account_holder: [],
account_number: nil,
bank_code: nil,
code: nil,
content: "CTPTY: REVENUE AUTHORITY REMIT:BAFZMSWI1434558SERIAL:000000000",
details: ["CTPTY: REVENUE AUTHORITY REMIT:BAFZMSWI1434558SERIAL:000000000"],
modifier: nil,
not_implemented_fields: [],
prima_nota: nil,
text_key_extension: nil,
transaction_description: nil
},
%MT940.ClosingBalance{
amount: #Decimal<25005.00>,
balance_type: :start,
content: "C200515ZMW25005,00",
currency: "ZMW",
date: ~N[2020-05-15 00:00:00],
modifier: "F",
sign: :credit
},
%MT940.ValutaBalance{
amount: #Decimal<25005.00>,
balance_type: nil,
content: "C200515ZMW25005,00",
currency: "ZMW",
date: ~N[2020-05-15 00:00:00],
modifier: nil,
sign: :credit
},
%MT940.FutureValutaBalance{
amount: #Decimal<25005.00>,
balance_type: nil,
content: "C200518ZMW25005,00",
currency: "ZMW",
date: ~N[2020-05-18 00:00:00],
modifier: nil,
sign: :credit
},
%MT940.FutureValutaBalance{
amount: #Decimal<25005.00>,
balance_type: nil,
content: "C200519ZMW25005,00",
currency: "ZMW",
date: ~N[2020-05-19 00:00:00],
modifier: nil,
sign: :credit
}
]
]