jehugaleahsa / FlatFiles

Reads and writes CSV, fixed-length and other flat file formats with a focus on schema definition, configuration and speed.
The Unlicense
357 stars 64 forks source link

RecordProcessingException: access to column position in chars #78

Open jods4 opened 3 years ago

jods4 commented 3 years ago

Is your feature request related to a problem? Please describe. When a large file fails to parse, it would greatly help to be able to precisely locate where the error is in the file. Row-wise this is covered by RecordContext.PhysicalRecordNumber. Column-wise I thought it would be covered by ColumnContext.PhysicalIndex but it's an index, not a column number.

Describe the solution you'd like Add ColumnContext.PhysicalPosition or similar.

Describe alternatives you've considered As mentionned above, we used ColumnContext.PhysicalIndex, but it's not enough to find the error position without referring to the specifications to determine the exact position of the faulty column.

Additional context E.g. in a failing file, our message says the error is in Column 4 (which is correct, as in the "4th data column") but inside the file it was at position 19, which would have been helpful to have.