Apr 1, 2002 #1 bader228 Technical User Joined Apr 1, 2002 Messages 1 Location 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 Joined Sep 20, 2001 Messages 464 Location 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.