不接广告么
写两个方法辣
#第一个
def output(filename)
str = ""
File.open(filename,"r+"){|f|
f.each_line{|line|
str += line.gsub(/,/,"\n")
}
}
str
end
result = output("example.txt")
#第二个
def input(filename,str)
File.open(filename,"w"){|f|
f.write str
}
end
input("example.txt",result)