Created
October 21, 2009 19:25
-
-
Save gmcinnes/215378 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
f = File.open('sinatra.log', 'r') | |
hashes = [] | |
str = "" | |
toggle = false | |
f.each_line do |line| | |
if line.match(/ \{.*/) | |
toggle = true | |
end | |
if toggle | |
unless line.match(/marktime/) | |
line = " }\n" if line.match(/ \}.*\x33/) || line.match(/ \}.*Open/) | |
str += line | |
end | |
end | |
if line.match(/ \}$/) || line.match(/ \}.*\x33/) || line.match(/ \}.*Open/) | |
str = str.gsub("{\\n", "{\n") | |
toggle = false | |
hash = eval(str) | |
hashes << hash | |
str = "" | |
end | |
end | |
ids = hashes.map do |hsh| | |
hsh['evaluation_id'] || hsh['adherence_check_id'] || nil | |
end | |
puts ids |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment