Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@AKB428
Created August 17, 2015 16:42
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 AKB428/68739719afb240da6d53 to your computer and use it in GitHub Desktop.
Save AKB428/68739719afb240da6d53 to your computer and use it in GitHub Desktop.
trans.rb
#ruby trans.rb every60min20150816.log
def parser(line)
list = line.split(',')
list[0..8]
end
open(ARGV[0]) {|file|
counter = 0
while line = file.gets
counter+=1
if counter == 1 then
p parser(line)
end
counter = 0 if counter == 60
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment