From: Gavin Sinclair Date: 2003-02-17T11:05:38+09:00 Subject: Re: count lines On Monday, February 17, 2003, 12:51:50 PM, Gavin wrote: > On Monday, February 17, 2003, 12:44:02 PM, Gustav wrote: >> Hi there, >> Is there a possibility to count the lines in a file with ruby? > count.rb > lines = 0 > ARGF.each do |line| > lines += 1 > end puts lines > Run it as: > ruby count.rb file ... > Gavin