I have a large text file that I would like a split into an arbitrary number of smaller ones. The behavior I need is nearly identical to the split
terminal command except that I need the files to overlap on their last lines. That is, the last line of the first file is the first line of the second file, the last line of the second file is the first line of the third file, et cetera.
The naive solution seems to read lines in from the original text file and split when necessary. I'm wondering if there is a standard library function that will allow me to deal with bytes rather than strings to more easily split the text file uniformly.
Is there something analogous to fseek
in Go that will let me do this?