From: Tor Erik Linnerud Date: 2008-05-29T10:06:47+09:00 Subject: Re: Is there a easy way to find and replay a match Cheyne Li wrote: > I need "aaa=4" in the file instead of just print out File.open('somefile', 'r+') do |file| content = file.read.sub('aaa=100', 'aaa=4') file.seek(0) file.write(content) } Read more about File at http://www.ruby-doc.org/core/classes/File.html although this documentation isn't the easiest to follow. Tor Erik -- Posted via http://www.ruby-forum.com/.