january radolf wrote:But how can i ignore rest of the lines??
In programming, you "ignore" something by just not doing anything. So simply read through the file one line at a time. For each line, store it in a variable but
don't do anything with it.
After you reach the end of the file, the last line you read was (naturally) the last line in the file. You just assigned it to a variable, though. Now
do something with it.