Hi tmaxial,
Supposing your file if made of variable-lenght rows (otherwise Wendy has alreaady pointed to the correct solution to your problem), the binary search you are speaking of can be impemented this way:
- Get the file lenght
- Move the file pointer to half the file lenght
- ReadLine () and discard the string
- The file pointer is now at the beginning of a new line: ReadLine and Scan the line row, next decide if and where to do the next jump
Now, the problem is that while it's easy to go forward (ReadLine helps a lot if it's an ASCII file) there is not a function to read the PRECEDING line in the file: this must be done by reading a character at a time...