R
Rebhan, Gilbert
Hi,
i want to count the occurence of a searchstring in all files
below a directory and all its subdirectories
i have =3D
matches=3D0
Dir.glob("E:/test/foobar/scripts/**/**.xml").each do |f|
matches +=3D File.new(f).read.scan('<if>').size
puts f
end
puts "Matchcount =3D=3D " + matches.to_s
puts "Scanned Files =3D=3D " +
Dir.glob("E:/test/foobar/scripts/**/**.xml").size.to_s
Is there a better way ?
Regards,
Gilbert
i want to count the occurence of a searchstring in all files
below a directory and all its subdirectories
i have =3D
matches=3D0
Dir.glob("E:/test/foobar/scripts/**/**.xml").each do |f|
matches +=3D File.new(f).read.scan('<if>').size
puts f
end
puts "Matchcount =3D=3D " + matches.to_s
puts "Scanned Files =3D=3D " +
Dir.glob("E:/test/foobar/scripts/**/**.xml").size.to_s
Is there a better way ?
Regards,
Gilbert