From: Robert Klemme Date: 2010-11-09T16:20:13+09:00 Subject: Re: Identify IP address from a text file and replace it with new address. On 11/09/2010 08:07 AM, Chandu80 wrote: > Thanks for the response.It did work.However isn't there a provision to > edit the same file and save it? ruby -p -i.bak -e 'gsub /\d{1,3}(?:\.\d{1,3}){3}/, "XX.XX.XX.XX"' a_file If you omit ".bak" there is no backup. Please see "ruby -h". Kind regards robert