in reply to Re: Replacing a search/not found pattern with a word
in thread Replacing a search/not found pattern with a word

Hi, My apology of giving incomplete info. These were the commands I tried. Actually I want to search from every line of my standard output file the word "DOG" and if not found replaced the entire line with the word "Not Found!". I was confused if I will use a conditional statements or simply using search & replace method. And I end up with the solution below:
#! c:\perl\bin\perl use Net::Telnet; @look=$net->cmd("cat $file | grep -i 'DOG' | awk 'NR==1' | nawk '{prin +t \$2}'); for $find (@look) { $find =~ s/(^DOG)/\uNot Found!/g; print "$find\n"; }
I intentionally replaced my standard input file due work related terminologies. =) Tnx so much indeed for your ideas and tips. Br,