From: Stephen Bannasch Date: 2006-03-24T06:31:35+09:00 Subject: variable substitution in strings read from a file I have a bunch of template documents which I need to manipulate in very simple ways. I'd like to be able to insert Ruby variables into the template. Here is a very short example: file fruit_template.txt: This is a fruit: #{fruit}. fruit = "apple" f = IO.read("fruit_template.txt") Then somehow I'd like to end up with this string: "This is a fruit: apple." This works fine of course if I construct the string in Ruby: s = "This is a fruit: #{fruit}." => "This is a fruit: apple." Thanks for any advice. -- - Stephen Bannasch Concord Consortium, http://www.concord.org