-
-
Save changs/ddb74be24d95fc82ed5d6387beb1c9f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!env ruby | |
require 'date' | |
from = Date.new(*ARGV[1].split(',').map(&:to_i)).to_time.to_i | |
to = Date.new(*ARGV[2].split(',').map(&:to_i)).to_time.to_i | |
File.open(ARGV[0]).each_line do |line| | |
/: (?<timestamp>\d+)/ =~ line rescue next | |
puts line if timestamp.to_i.between?(from, to) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment