moov-io / bai2

BAI2 file format is a cash management balance reporting standard
Apache License 2.0
15 stars 9 forks source link

bug in reader.go #113

Closed marvv closed 3 months ago

marvv commented 3 months ago

It failed to parse a bai2 file got from our corrleate bank. Meanwhile i use a python library sucessfully parse the same file.

After review moove-io/bais's code (version v0.3.0), i think it's a bug in reader.go, line 72. In my case, the transaction part contains date string like "24/03/26", current impletation will wrongly treat is as full line which is not.

To reproduce the bug, you can use a test bai2 file and add something like "2024/4/11 XRR" to the text field of a transaction line, then see if the file can be parsed successfully.

I comment Line 72 in reader.go, and the file can be parsed , but the text part is trimed . It takes time to see how to solve it.

adamdecaf commented 3 months ago

Fixed in https://github.com/moov-io/bai2/pull/116