Software Development Network>> Visual C#>> Count Line
Hi!
TextReader tr;
...
while(tr.ReadLine()!=null) counter++;
Atilla Koklu wrote:How to CountLine in notepad file
You could read blocks at a time and count the \r\n occurrences. That way you avoid having to load the entire file into memory all at once.
Count Line
WFrobozz
Hi!
TextReader tr;
...
while(tr.ReadLine()!=null) counter++;
Chris Treadaway - MSFT
You could read blocks at a time and count the \r\n occurrences. That way you avoid having to load the entire file into memory all at once.