Board index » ruby
All times are UTC
Is there a possibility to count the lines in a file with ruby?
Any anwer would be very helpful.
Thanks
Gustav
lines = 0 ARGF.each do |line| lines += 1 end
Run it as:
ruby count.rb file ...
Gavin
open("filename"){|f| p f.readlines.size}
Shin
>Is there a possibility to count the lines in a file with ruby?
>Any anwer would be very helpful.
>Thanks
>Gustav
> open("filename"){|f| p f.readlines.size}
> Shin
> >Hi there,
> >Is there a possibility to count the lines in a file with ruby?
> >Any anwer would be very helpful.
> >Thanks
> >Gustav
Thanks a lot.
> > open("filename"){|f| p f.readlines.size}
> > Shin
[...] > Very nice.
> Thanks a lot.
Hugh
1. Match then count lines
2. Counting lines in a report
3. counting lines in a report
4. how can i count line wich begins with NCOUNT word
5. Count lines in text file
6. Program that counts lines per minute
7. A tool to count lines in Ada programs
8. No More Counting Lines of COBOL Code
9. how to count lines in a file ?
10. how to count lines in a file ?
11. Counting lines of code in Prolog (source code)
12. counting lines