From: "Rebhan, Gilbert" Date: 2007-08-24T23:19:44+09:00 Subject: Dir, recursive filescan Hi, i want to count the occurence of a searchstring in all files below a directory and all its subdirectories i have = matches=0 Dir.glob("E:/test/foobar/scripts/**/**.xml").each do |f| matches += File.new(f).read.scan('').size puts f end puts "Matchcount == " + matches.to_s puts "Scanned Files == " + Dir.glob("E:/test/foobar/scripts/**/**.xml").size.to_s Is there a better way ? Regards, Gilbert