From: Derek Smith Date: 2009-08-27T04:34:55+09:00 Subject: Re: find string, get line number or position, then restart at +1 Eric Hodel wrote: > On Aug 26, 2009, at 08:44, Derek Smith wrote: > >> Ok so I have a file where I am searching for the string "Jul 14.*" for >> example using a regexp and this is working fine. However I have been >> debating on how to move forward with what code, $. or tell with seek? > > If it's a small file, use StringScanner: > > require 'strscan' > > text = File.read the_file > scanner = StringScanner.new text > scanner.scan /Jul 14/ > > # ... > > ri StringScanner for details. Thank you all for your replies! I understand all of them! Derek -- Posted via http://www.ruby-forum.com/.