From: Michael Tomer Date: 2008-11-21T01:47:29+09:00 Subject: Re: Finding and writing to specified area in a text file A gsub (global substitution) should take care of the problem. Here's an example of how I might do this: ###################################################### data = "" File.open("my_file.txt", "r") do |file| data = file.read.gsub("INSERT", "new word") end File.open("my_file.txt", "w") do |file| data = file.write(data) end ###################################################### The gsub command also supports regular expressions, if you need it. -- Posted via http://www.ruby-forum.com/.