From: Sukhwinder Tambar Date: 2009-01-15T15:16:25+09:00 Subject: Re: Reading RTF + Text File and pattern matching Thanks Jarmo Pertman for the little way to do this. i am using append mode bcz i have lot of Pattern need to be replace with my date dynamically. so i open the file in append mode inside the loop. One more thing. in text file gsub find the required pattern easily but while reading from RTF file we get the data in other way. so i did this line= line.gsub!(//, Date.today) i am agree with map you used. bye the thank for shorter the code. -- Posted via http://www.ruby-forum.com/.