Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save googya/956908 to your computer and use it in GitHub Desktop.
Save googya/956908 to your computer and use it in GitHub Desktop.
清除那些有效评论很少的专家
test_dir = Dir.open("expert ratings")
test_dir.entries[2..-1].each do |f|
begin
file = File.open("E:\\ratings_all\\expert ratings\\"+f.to_s)
rescue Errno::ENOENT=> error
next
end
fsize=file.size
file.close
File.delete(file) if fsize<9000
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment