File::open("log.txt") do |f| current = "" count = 0 f.each do |a| #抽出部は適宜変更 target = /\[(.+)\]/.match(a)[1].split("/")[2][5, 2] if target != current count = 1 current = target print "\n" + current + " : *" else print (count % 100 == 0) ? "*" : "" count = count + 1 end end end