From: Peter Marks Date: 2007-08-28T15:34:51+09:00 Subject: Re: Conducting Regular Expressions on a text file Follow up question: How might I be able to make multiple placeholders within a text file? I thought this would work: File.open("source.txt", "r") do |src| File.open("sink.txt", "w") do |sink| src.each_line { |line| sink.write(line.gsub(/placeholder/, "word")) sink.write(line.gsub(/placeholder2/, "word2")) } end end , but my newbie assumptions were mistaken. Any ideas? Thanks, Peter -- Posted via http://www.ruby-forum.com/.