Hi,
I want to search a pattern from each line of my print output with a word "DOG". And those lines without the word "DOG" I will replace the entire line with the word "Not Found". How can I do it? Pls advice. Tnx in advance.
Input:
Desired Output:
Br,
Pete
I want to search a pattern from each line of my print output with a word "DOG". And those lines without the word "DOG" I will replace the entire line with the word "Not Found". How can I do it? Pls advice. Tnx in advance.
Input:
Code:
My DOG name
*** CAT is in the kitchen
Name DOG
*** CAT is in the kitchen
My DOG name
My DOG name
My DOG name
My DOG name
print $animals | grep 'DOG' | nawk '{print $2}'
Code:
DOG Not Found DOG Not found DOG DOG DOG DOG
Br,
Pete
Comment