Hi all
I have a file which has n no. of lines. I want to find string called "John"
and add 5 lines below the string. Help me to do it using script?
Hi all
I have a file which has n no. of lines. I want to find string called "John"
and add 5 lines below the string. Help me to do it using script?
Hi
awk 'BEGIN{OFS="\n"}
$0 ~ /john/{t=1;}
t==1{print;print "line1","line2","line3",line4","line5";t=0;next}1' filename
Thanks
Penchal