EDIT: If the code is big, just post the relevant parts. How big is big anyway? A few hundred lines is not a big deal, though less is better if I don't need all of it.
Okay, so since you have a text file, I would use fgets to read a line, then use sscanf to parse a line. What you want to do is keep reading lines until you reach the end of the file. When you do, fgets will return NULL, and your buffer will still contain the last line read, i.e. the last line of the file:
Code:
char buf[MAX_LINE_LEN]; // #define that to be a sensible number
while (fgets(read into buf) != NULL) {
}
// fgets has return NULL, hopefully because you're at the end of the file. Let's check
if (feof(fp)) {
if (sscanf(buf, pick a format string and parameters as necessary) == ???) {
you found the last number of the last line, do something with it
}
}
else {
must be some kind of error reading the file, report it
}
I am leaving it up to you to read up on the fgets and sscanf functions to fill in the remaining parts of this. You are in school to learn after all, and me handing you a complete solution would rob you of that. A simple Google search should turn up the official documentation for the functions, and dozens (hundreds? thousands?) of tutorials on those functions.
I will tell you, if you just want to skip the date, time and letter code columns in the file, I would use the string format specifier along with the assignment suppressor modifier to just skip over them.
Give it your best shot, and post back if you have trouble.