I have a flat file that has 339276 line of text in it for a size of 62.1 MB. I am attempting to read in all the lines, parse them based on some conditions I have and then insert
bufio.Scan()
and bufio.Text()
in a loop perfectly works for me on a files with much larger size, so I suppose you have lines exceeded buffer capacity. Then
path, err :=r.ReadLine("\n") // 0x0A separator = newline
? Looks like func (b *bufio.Reader) ReadLine() (line []byte, isPrefix bool, err error)
has return value isPrefix
specifically for your use case
http://golang.org/pkg/bufio/#Reader.ReadLine