Dan,

For Go 1.17:

encoding/csv: add the ability to get the line number of a record #44221
https://github.com/golang/go/issues/44221

Peter

On Thursday, April 8, 2021 at 12:36:27 PM UTC-4 yodanj...@gmail.com wrote:

> My need is similar to issue #26679 but not the same.
>
> I am using 1.15.8
>
> I have a need for the "current line number" when reading a csv file (with 
> Reader.Read() ) so that I can report errors in the data (not a csv 
> parsing error but errors in the data in the csv file).  In my case, a 
> comment character is being used to allow my user to provide comments in the 
> file for easier maintainability of their csv data.  Because of comments in 
> the file the record number and line number are not the same so any 
> reporting of errors to my user cannot point to any specific line number in 
> the file for the data error ... I have to either give info on the record to 
> my user or tell them the non-commented line number (neither being a 
> user-friendly option as they have to look through the file to see where the 
> real error is instead of going to a specific line number).
>
> Any way to get the true (starting) line number of the current record as a 
> file is being read using the Reader.Read() function?
>
> Thanks
> Dan
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/8e14073a-f934-4108-a169-f220e0bfe6b9n%40googlegroups.com.

Reply via email to