>>654
# 読み書き両用で、ファイルを開く
File.open('a.txt', 'r+') do |file|
str = file.read
str.gsub!(/\n記事/, '記事')
file.print(str)
end

Rubyで作った。
ファイルをバックアップしてから、試して