getLineCount will rewind the file pointer after counting the number of newline characters