From: Brian Candler Date: 2009-08-27T00:17:28+09:00 Subject: Re: find string, get line number or position, then restart a Derek Smith wrote: > Goal is to find pattern in file, note line number in same file, discard > all prior lines while storing all proceeding lines after pattern was > found? f.each_with_index { |line,lineno| ... } is a simple way to iterate over the lines and have the line number (starting at 0) too. I should point out that Ruby does inherit this horrible Perlism: $ ruby -ne 'print if /sshd/../ntp/'