From: Cheyne Li Date: 2008-05-29T08:18:09+09:00 Subject: Re: Is there a easy way to find and replay a match I need "aaa=4" in the file instead of just print out Tor Erik Linnerud wrote: > >> If I have file and has a line is "aaa=100", and need to replace it as >> "aaa=4". > >> puts File.read('somefile') > foo > aaa=100 > bar > >> puts File.read('somefile').sub('aaa=100', 'aaa=4') > foo > aaa=4 > bar > > Tor Erik -- Posted via http://www.ruby-forum.com/.