Closed YaraslauZhylko closed 6 months ago
This would track record numbers, not line numbers. Records can span multiple lines.
Makes sense.
Still, csv
nadles the actual line count inside the reader
class.
And in aiocsv
its functionality is basically replaced by parser
/_parser
that seem to be aware of the nmbe rfo new lines that got processed to get one record.
Will it be hard to implment the count there?
This should probably be easy to implement, since parser is internal it can just yield line_num, record
instead of yield record
. I just never been bothered to implement this.
In my particular case I need to report CSV file errors and I need the actual line numner to associate with the error.
Hi!
Is there a reason why
line_num
functionality is not implemented for theAsyncReader
?Seems to be as easy as adding
self._line_num += 1
to theAsyncReader.__anext__()
method.Are there any less obvious implementation details that I'm missing? :thinking: