I tried unxutils\' wc -l but it crashed for 1GB files. I tried this C# code
wc -l
long count = 0; using (StreamReader r = new StreamReader(f)) { st
I think that your answer looks good. The only thing I would add is to play with buffer size. I feel that it may change the performance depending on your buffer size.
Please refer to buffer size at - Optimum file buffer read size?