old = File.open(ARGV[0]).collect
new = File.open(ARGV[1],"a+")
for i in 0..old.length-1
new.write(old.uniq[i])
end
##或简单两行也可以如qc.rb
old = File.open(ARGV[0]).collect
puts old.uniq
然后qc.rb dic.dic >new.dic
new = File.open(ARGV[1],"a+")
for i in 0..old.length-1
new.write(old.uniq[i])
end
##或简单两行也可以如qc.rb
old = File.open(ARGV[0]).collect
puts old.uniq
然后qc.rb dic.dic >new.dic
标签:
ruby,文件,重复的行
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
内蒙古资源网 Copyright www.nmgbbs.com
暂无“ruby 去掉文件里重复的行”评论...