in reply to Re: Retrieve & Replace strings in one Perl line.
in thread Retrieve & Replace strings in one Perl line.

The output of the 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;' GPPRegistry.temp.reg
"DSN"="jupiter"
"DSN"="jupiter"
  • Comment on Re^2: Retrieve & Replace strings in one Perl line.