Created
August 17, 2015 16:42
-
-
Save AKB428/68739719afb240da6d53 to your computer and use it in GitHub Desktop.
trans.rb
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
#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