11
3
I have to read a large file and before I start reading it, I need to know the total number of lines in the file (which are in millions).
I have implemented a lot of solutions and have found one. But during my search I was thinking to look at how wc -l
works. I couldn't find anything on Google.
Though I have found a solution to my problem, I would still like to know how wc -l
works since it can calculate the number of lines of a file with 92 Million lines in a few seconds!
How?
6http://lingrok.org/xref/coreutils/src/wc.c – Arjan – 2013-07-08T17:17:08.640