printing lines to a file from a particular string

Hi,
A very Good Evening to All,
I am writing a script for my application. I have a file with 1000 lines. Among that 1000 lines i am searching for a particular string. And from that string i need to pull all the data in to a seperate file.

For example the contents of my file is as below.

  1. raju
  2. raju
  3. raju
  4. Wed Mar 16 20:15:22 2005
  5. hello
  6. i am very good person.
  7. Wed Mar 16 20:15:22 2005
  8. hello
  9. Hi
  10. Wed Mar 17 20:15:22 2005
  11. hello
  12. hi.

There will be no line numbers in my file i have give just for our reference.
Now i am searching for a string using the below command.

grep "Wed Mar 16.*2005" raju.log | head -1. So the command output will be the 4th line. So from now from the 4th line i need to pull all the lines from 5 to 12 in to file.

Please let me know how to achieve this.

Thanks,
Raju

awk '/Wed Mar 16.*2005/ && !f {c=8;f=1;next}c-->0' file > newfile

This command delete from the first line to the line having pattern "Wed Mar 16.*2005"

sed "1,/Wed Mar 16.*2005/d" file

This command prints along with your pattern "Wed Mar 16.*2005" to the end of file

sed "/Wed Mar 16.*2005/,$ !d" file

Try:

awk '/Wed Mar 16/ { c=1; } c==1  && f++<9 && f>1' < infile >outfile

hi Anbu23,
thank you so much. it worked like a charm.

Thanks,
Raju