I have a file which contains ascii data. How I can read the specified row from it to buffer? The file contains over 2000 rows, what is the most reasonable solution?
RFile handling
How to do this depends strongly on how the rows are separated.
If they are fixed length, then you can just use a Seek(length*row) to get to the right place.
If there is some index in the file, use that.
If the rows are really lines, and there's no way to tell where the lines fall, you will have to process each byte in the file to find where the rows are. To do this, create a buffer, fill it using RFile::Read() and then process the buffer, counting the number of row separators you find. Then reload the buffer and continue, until you find the row you're looking for. At that point, copy the data out of the buffer to where you want it.
The only tricky bit will be coping with a row that isn't entirely contained in the buffer.