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!!!
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!
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.