-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcollateCounts.rb
More file actions
41 lines (37 loc) · 1.23 KB
/
collateCounts.rb
File metadata and controls
41 lines (37 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/ruby
def get_file_list(fn)
f = File.new(fn)
fl = []
begin
while (line = f.readline)
line.chomp!
fl.push(line)
end
rescue EOFError
f.close
end
fl
end
filelist="../ReflectionResults/filelist"
output="../ReflectionResults/stats/totalcountlist"
output2="../ReflectionResults/stats/probcountlist"
$count= {}
File.open(output, 'w') {|f| f.write("Name \t\t\t\t\t\t\tNum found Num Done Num obj Total\n") }
File.open(output2, 'w') {|f| f.write("Name \t\t\t\t\t\t\tNum found Num Done Num obj Total\n") }
get_file_list(filelist).each() do |filename|
$count= {}
puts filename
File.open("../ReflectionResults/#{filename}/count") do |f|
$count=Marshal.load(f)
end
appname=filename.split('/')[1]
if appname.size<55
spaces=55-appname.size
spaces.times{|i| appname=appname.concat(' ')}
end
type=["numfound", "numdone", "objfound", "total"]
File.open(output, 'a') {|f| f.write("#{appname}\t\t#{$count['numfound']}\t#{$count['numdone']}\t#{$count['objfound']}\t#{$count['total']} \n") }
if $count['total'] != 0 and ($count['total'] != $count['numfound'])
File.open(output2, 'a') {|f| f.write("#{appname}\t\t#{$count['numfound']}\t#{$count['numdone']}\t#{$count['objfound']}\t#{$count['total']} \n") }
end
end