While looking around for a while I found quite a few discussions on how to figure out the number of lines in a file.
For example these three: c# how do I count l
public static int CountLines(Stream stm) { StreamReader _reader = new StreamReader(stm); int c = 0, count = 0; while ((c = _reader.Read()) != -1) { if (c == '\n') { count++; } } return count; }