Determining number of lines in a File without loading it to memory
807580Nov 30 2009 — edited Dec 1 2009hello guys,
I'm just wondering if there is a way to know the number of lines in a file without having to load the file entirely into memory and count the lines.
in my project i have a restriction that says that i'm not allowed to load into memory more than 10 KB. i have to read the file block by block, say ten lines at a time.
I actually did the second point which is reading the file 10 lines at a time, but still the total number of lines is still hard coded.
thank you for your help !
I