I have a simple script that does some search and replace. This is basically it:
File.open("us_cities.yml", "r+") do |file|
while line = file.gets
"do find a replace"
end
"Here I want to write to a new file"
end
As you can see I want to write a new file with the output. How can I do this?