From: Andrea Maschio Date: 2007-02-02T06:35:21+09:00 Subject: Parsing text files with dynamic contents ------=_Part_19493_2421895.1170365710787 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Let's guess a simple example: i need to parse a text file, wityh variables inside, and then output again the resulting text to a file or to screen. -------------start example text------------ hello, it is #{now}, your name is #{name} -------------end example text------------ variables could be written also $var, or whatever else could be better. but obviously when i do file.each do |line| puts line #here i need to do something to find the variable and output the correct value end How would you ruby experts do the correct parsing to output values instead of the text content? Is there any class available that do this? Thank you very much for helping -- Andrea Maschio http://www.superandrew.it "The real problem is not whether machines think but whether men do." (B. F. Skinner ) ------=_Part_19493_2421895.1170365710787--