Noame has asked for the wisdom of the Perl Monks concerning the following question:
The output of the following command is:
perl -ne "print if /\\bnapre/i || /\\bjupiter/i;" GPPRegistry.temp.reg "DBLogin"="napre" "DSN"="jupiter" "DBLogin"="napre" "Login"="napre" "Password"="napre" "DBLogin"="napre"
I want in the same command to replace "napre" with "TEST1" and present it (Not change the file yet). after this command the fields include "napre" are despaired and the replacement of "napre" weren't be shown
perl -ne 's/napre/Text1/gi; print if /\bnapre/i || /\bjupiter/i;' GPPR +egistry.temp.reg "DSN"="jupiter" "DSN"="jupiter"
20071115 Janitored by Corion: Removed color, font tags, added formatting, code tags, as per Writeup Formatting Tips
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl in one line: Retrive & Replace
by ikegami (Patriarch) on Nov 13, 2007 at 21:21 UTC | |
|
Re: perl in one line: Retrive & Replace
by igelkott (Priest) on Nov 13, 2007 at 21:36 UTC |