Apr 1, 2002 #1 bader228 Technical User Apr 1, 2002 1 BH i want to search for a string but the action "print" will take effect on a different line?
Apr 1, 2002 1 #2 aigles Technical User Sep 20, 2001 464 FR Hi, Can you say us more about what you want to do ? The following script is just an example of a script that print the third line after each line containing the string "KEYWORD" : /KEYWORD/ { ToPrint[NR+3]=1; } { if (NR in ToPrint) { print $0 delete ToPrint[NR] } } Jean Pierre. Upvote 0 Downvote
Hi, Can you say us more about what you want to do ? The following script is just an example of a script that print the third line after each line containing the string "KEYWORD" : /KEYWORD/ { ToPrint[NR+3]=1; } { if (NR in ToPrint) { print $0 delete ToPrint[NR] } } Jean Pierre.