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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find string & grab next 10 lines... 8

Status
Not open for further replies.

isileth

Technical User
Jul 18, 2001
9
US

OK, am searching a file for a certain text string - when I find it, I need to output the line it's in, and the following 10 lines?

Any help much appreciated.
 
It was not designed to be used on files having more than one "foo". This is:
Code:
/foo/&&c=10,!c--
This may not do what you want if "foo" is found in one of the trailing 10 lines.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top