I have a file that contains many lines, I am using a streamreader to read the file. What I need to do is count how many lines there are in this file, but at certain points the file contains a line of text as such: "-----". SO what I need to do is count the number of lines in the file excluding the lines that contains "-----".
I do not want to use the streamreader like this:
StreamReader reader = new StreamReader();
var x = reader.ReadLine()
and check if x contains "-----" and if it does increment a counter, as this is very intensive as the file would be a huge file.
Any help is much appreciated.
Thanks in advance.