Lets say I have 10 lines in a file. I have 2 parameters that specify the beginning and ending of a index.
StartIndex = 2 // specifies the first 2 lines
EndIndex = 3 // specifies the last 3 lines
I need to read the lines in between. I know maintaining index and skipping is one of the ways…but are there any other efficient ways (even with external libraries)?
Thanks
Using the commons IO you can do it easily, but it is not efficient because it will load the whole file in memory.
http://commons.apache.org/io/