I\'m processing huge data files (millions of lines each).
Before I start processing I\'d like to get a count of the number of lines in the file, so I can then indic
You can read the last line only and see its number:
f = File.new('huge-file') f.readlines[-1] count = f.lineno