Operating System - HP-UX
1753906 Members
9155 Online
108810 Solutions
New Discussion

Re: See lines after a "date" given.

 
SOLVED
Go to solution
Manuales
Super Advisor

See lines after a "date" given.

Hi, i have a log, big log like this

cat BIG.LOG

May 10 2011 .....
.........
May 11 2011 .....
.........
May 12 2011 .....
.........
......
May 13 2011 .....
.......
May 14 2011....
. line 1
..line 2
..line 3
..line 4
..line 5
..line 6

could you please how to get only the lines
from "May 14 2011" into another file?
I mean, only this:
May 14 2011....
. line 1
..line 2
..line 3
..line 4
..line 5
..line 6


thanks in advance.
Manuales.





2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: See lines after a "date" given.

Hi:

There are multiple ways. Here is one of the shortest:

# sed -ne '/May 14/,/May 15/'p file

...or: to extract from there to the end of of the file:

# sed -ne '/May 14/,$'p file

Regards!

...JRF...

Manuales
Super Advisor

Re: See lines after a "date" given.

Thanks a lot, it worked.
i assigned your points, 10, is it ok? when i click the page was disconected, please verify.ñ