Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. aqnjrtek

    printing lines before and after a match

    Oh, by the way. With these scripts, how do I include the fact that the second column should be >0 for it to be a match --- for both grep and awk commands? Thanks!!!
  2. aqnjrtek

    printing lines before and after a match

    Thanks a lot for these suggestions. I will try both of them. I also tried to use both awk and R and it worked but these two suggestions are concise and seem to be better. Wow!
  3. aqnjrtek

    printing lines before and after a match

    Hello!!! I am an awk newbie. I just want to know how to print the whole range of 19 lines before and 26 lines after a match. I used awk '{if ($1=="pattern" && $2>0) print}' input.file I got all that matched but I need the match plus 19 lines before it and 26 lines after it. Thanks a lot...

Part and Inventory Search

Back
Top