Count the number of lines in a textfile