Skip to content

Instantly share code, notes, and snippets.

@changs changs/hist
Created Jan 15, 2017

Embed
What would you like to do?
#!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
You can’t perform that action at this time.