rubyでファイルの重複行を削除する方法

方法1
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

方法2
old = File.open(ARGV[0]).collect
puts old.uniq

Ruby

Posted by arkgame