(Python) Counting lines in a huge (>10GB) file as fast as possible
(Python) Counting lines in a huge (>10GB) file as fast as possible Question: I have a really simple script right now that counts lines in a text file using enumerate(): i = 0 f = open(“C:/Users/guest/Desktop/file.log”, “r”) for i, line in enumerate(f): pass print i + 1 f.close() This takes around 3 and a half …
Total answers: 5