If you want to do this, create a ByteCount reader that wraps the underlying 
reader and pass that to the csv reader. 

> On Oct 31, 2020, at 9:52 AM, peterGo <go.peter...@gmail.com> wrote:
> 
> 
> Severyn,
> 
> The best way to deal with this issue is to redefine the issue. Use csv lines 
> not bytes as the measure.
> 
> For example, 
> 
> https://play.golang.org/p/unSQ5e_hqCb
> 
> Peter
> 
>> On Friday, October 30, 2020 at 10:17:26 PM UTC-4, Severyn Lisovsky wrote:
>> Hi,
>> 
>> I have difficulty counting bytes that were processed by csv.Reader because 
>> it reads from internally created bufio.Reader. If I pass some counting 
>> reader to csv.NewReader it will show not the actual number bytes "processed" 
>> by csv.Reader to receive the output I get calling csv.Reader.Read method, 
>> but the number of bytes copied to bufio.Reader's buffer internally (some 
>> bytes may be read during next csv.Reader.Read call from the buffer).
>> 
>> Is there a way I can deal with this issue by not forking encoding/csv 
>> package?
>> 
>> To give you more high-level picture - I want to split remote csv file to 
>> chunks. Each chunk should be standalone csv file - starting from actual 
>> beginning of the line, ending with newline byte. So I'm trying to do the 
>> following - split file size by the number of chunks, and for each chunk - 
>> skip first bytes up to newline symbol and read to offset+chunkSize+[number 
>> of bytes to the next newline symbol]
> 
> -- 
> 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/cf20e79f-5683-446e-bda1-4029875e4860o%40googlegroups.com.

-- 
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/D6D57692-BA1B-4290-AB5E-11A6BA88CD40%40ix.netcom.com.

Reply via email to