I\'ve googled this like crazy, and I can\'t seem to find any reference at all to this particular type of problem.
I have a StreamReader
object with a file,
Stream.Seek()
(MSDN docs) is what you need, but that's an absolute position in the file, and has no notion of line breaks.
I'd prefer to read the lines into a collection memory, then iterate over the collection in memory as often as you like before loading the next few lines in. In fact, unless you're talking gigglebytes of data, just read all the lines in as string
objects in a List
and do whatever you need with it.