If you know the offset in the data file you want, you can always fseek () . Of course, the problem is to discover where you need fseek within the file. If you can use SEEK_END as an option, then the offset will refer to the end of the file instead of the beginning, which may be useful to you.
Alternatively, you can use the file () function to load the file data into an array. Each element of the array is a line of the file, so the second and last element in the array will be the element you want.
source
share