Skip to content

Instantly share code, notes, and snippets.

@martin2110
Created November 10, 2015 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martin2110/7561662c57a0d170a3d4 to your computer and use it in GitHub Desktop.
Save martin2110/7561662c57a0d170a3d4 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
logfile='logfile.txt'
File.read(logfile).split("\n").each do |ln|
if ln =~ /(^\d\d\d\d-\d\d-\d\d)(.*)(\d\d\d\d-\d\d-\d\d)(.*)/
puts $1 + $2 + $4
else
puts ln
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment