Open pajusin opened 2 years ago
I faced a similar issue. Just to summarize again, there are 2 conditions that need to be true to reproduce the error:
(So there is a gap between the second last and the last field from position 16 to position 19)
In this case, the value is assigned to the actual last column (i,.e. Labor Cost Code field) rather than being considered part of the gap field and ignored.
i.e. if row is: SNO___COSTIN_ABCD
so after parsing, the values of fields will be:
SNO_
COSTIN
ABCD
Whereas they should be: SNO_ COSTIN null
As long as the last field contains characters <= gap field length, this error will manifest. As soon as we have more characters than the gap field the result will become correct.
MY WORKAROUND for this was to define the gap field explicitly and ignore it in the code.
FixedWidthParser returns wrong result if parsed row is smaller than annotation setting (from, to). See unittest