I have a huge file that looks like this:
7
bla1
blala
blabla
blab
blals
blable
bla
more here..
The first numbers tells how many values I will have. The thing, is that i just want to point directly to the line 11 (text "more here.."), without having to read all those values before. In my case, I have a big amount of numbers, so it has to be optimized.
Would you recommend me something?
You could probably use File#seek to randomly access the file.
The problem with that approach is that it will just access data at a specified byte offset - not a line offset. If your file could give the byte offset at the start of the file to where the list finishes, then you could use that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With