Count Line

How to CountLine in notepad file


Answer this question

Count Line

  • WFrobozz

    Hi!

    TextReader tr;

    ...

    while(tr.ReadLine()!=null) counter++;



  • Chris Treadaway - MSFT

    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