[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Is there a easy way to find and replay a match

Heesob Park

5/29/2008 2:19:00 AM

Hi,

Cheyne Li wrote:
> Hi,there
>
> If I have file and has a line is "aaa=100", and need to replace it as
> "aaa=4".
> Is there a way to do it without iterating each line and find the match,
> then replace it? Thank in advance

ruby -i -pe'gsub(/aaa=100/,"aaa=4")' somefile

Regards,

Park Heesob
--
Posted via http://www.ruby-....