Line counter for text files