Print lines after grep

Hi all,

I need help in following scenario. I have a file with about 10,000 lines. There are several lines which have word "START" (all upper case) in them. I want to grep line with word "START" and then do the following

  1. Print the line number having word "START"
  2. Print the next 11 lines.

Any help is appreciated.
JAK

awk '/START/{f=NR;print NR}{if(NR > f && NR < f+12) print}' data.file

Another one:

awk 'c&&c--;/START/{print NR;c=11}' file

Use nawk or /usr/xpg4/bin/awk on Solaris.

That's nice :b:

Thanks for the reply. I really appreciate it.

JAK