From: Christopher Graves Date: 2012-01-20T08:19:21+09:00 Subject: Re: Parsing log with date time entry I finally got a little more time to work on this. I went the route of comparing the current time to the string value and came up with this require 'time' s_time = (Time.now - (15*60)) e_time = Time.now range = (s_time.strftime("%m/%d/%Y %H:%M")..e_time.strftime("%m/%d/%Y %H:%M")) time = s_time.strftime("%m/%d/%Y %H:%M") Dir["*.log"].each |path| File.open( path ) do |s| s.grep( /#{range}/ ) do |line| puts line end end end the issue is the range variable is not catching anything. When I use the time variable it works as expected if there is a matching entry in the log hmm maybe next I should try to compare the entry in the log to the time range.... -- Posted via http://www.ruby-forum.com/.