Well, looking at the code you've provided showing what you've tried so far . . .
Oh, you didn't. Never mind.
Read the line. Extract the timestamp. Parse the timestamp (see Date::Manip, Date::Calc). Compare with now. Print if it's within your window.
Update:
require 'time' now=Time.now ARGF.each do |line| next unless line =~ /(.*?) : Depth/ d_days = ( now - Time.parse( $1 ) ) / 86400 puts line if d_days < 45 end
In reply to Re: grep for last 45 days
by Fletch
in thread grep for last 45 days
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |