in reply to perl in one line: Retrive & Replace
perl -ne 's/napre/Text1/gi; print if /\bText1/i || /\bjupiter/i;' GPPR +egistry.temp.reg
If you want to check if the original line contains napre, check before doing the replacement.
perl -ne 'next if !(/\bnapre/i || /\bjupiter/i); s/napre/Text1/gi; pri +nt' GPPRegistry.temp.reg
By the way, putting your code in <c>...</c> tags will format it properly, handle escaping for you and handle wrapping if necessary.
|
|---|