File > 5Gb, simply with lines like apache access.log.Need to get number of lines.Any constructions likefile(filename).read().counter('\n')Would read all of files and it would be very long time.e.g.os.stat(filename).st_sizeWorks very fast.It is possible to get at least hypothetically number of lines, by size of first lines in bytes and total size of file.  Is there more accurately way?
What is the most optimal algorithm for counting lines of text in a file?
python;files