From: Kurt Euler Date: 2002-06-08T15:06:50+09:00 Subject: Help: Improper use of gsub? All- The code below correctly creates one copy of file "template.txt" for each line in the file "packages.txt", and names each copy with the text in field[0] in each line. For each copy, I am trying to replace the string "" with the file object fs (a very short file). However, the "" string is not bing replaced. Am I making incorrect use of the gsub method (in 2nd line from bottom)? If so, please suggest a correction. content = File.new("template1.txt").read fs = File.new("fiddle.sticks").read IO.foreach("packages.txt") { |x| field = x.chop.split(':') content2 = content content2.gsub(//, fs) File.new(field[0],"w+").write(content2) } Thanks. -Kurt Euler