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.
- raju
- raju
- raju
- Wed Mar 16 20:15:22 2005
- hello
- i am very good person.
- Wed Mar 16 20:15:22 2005
- hello
- Hi
- Wed Mar 17 20:15:22 2005
- hello
- 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