From: Christopher Graves Date: 2012-01-21T04:21:58+09:00 Subject: Re: Parsing log with date time entry The Rio way looks interesting but even after installing the gem it is not working right on my test log. I did manage to get it working require 'time' s_time = (Time.now - (15*60)) e_time = Time.now range = (s_time.strftime("%m/%d/%Y\s%H:%M:%S:%L")..e_time.strftime("%m/%d/%Y\s%H:%M:%S:%L")) Dir["*.log"].each {|path| File.readlines( path ).each do |sort| sort.scan(/^\d{2}\/\d{2}\/\d{4}\s\d{1,2}\:\d{2}\:\d{2}\:\d{1,3}/).each do |time| if range.cover? time puts sort end end end } What do you guys think? Thanks for pointing me in the right direction. Without all of your help this little project would ahve taken me a lot longer than it did. -- Posted via http://www.ruby-forum.com/.