【Ruby】ファイルの重複行を削除
1.delone.rb
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.deltwo.rb
old = File.open(ARGV[0]).collect
puts old.uniq
Coding Changes the World
1.delone.rb
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.deltwo.rb
old = File.open(ARGV[0]).collect
puts old.uniq