Re: get all lines between two lines
- From: Christoph Spohr <xulxer@xxxxxxxxx>
- Date: Mon, 22 Sep 2008 17:43:56 -0700 (PDT)
Sorry for talking to myself, but if your file is realy large, you
should use
sed -n '/^AFTERTIMESTAMP2/q;^TIMESTPAP1/,/^TIMESTAMP2/p' LOGFILE >>
NEWFILE
the new first part will quit the execution after the required part is
printed out.
Kind regards
Chris
Christoph Spohr wrote:
Hi,.
something like
sed -n '/^TIMESTPAP1/,/^TIMESTAMP2/p' LOGFILE >> NEWFILE
should do the trick.
Kind regards
Chris
AFC wrote:
I have a huge file (more than 8 million lines), it is a log file and
each message body starts with timestamp information. Sample:
2008-09-19-06.05.40.704851-240 I516287092C387 LEVEL: Severe
PID : 413900 TID : 1 PROC : db2agent (DB)
0
.
.
.
.
.
.
.
2008-09-20-06.05.40.704851-240 I516287092C387 LEVEL: Severe
.
.
.
.
I would like to get details between two timestamps, like I need all
lines saved to a new file that are between 2008-09-19-06.05.40.704851
and 2008-09-20-06.05.40.704851.
could someone point me to right direction on how I should approach
this? Thanks!
- Follow-Ups:
- Re: get all lines between two lines
- From: Bo Yang
- Re: get all lines between two lines
- References:
- get all lines between two lines
- From: AFC
- Re: get all lines between two lines
- From: Christoph Spohr
- get all lines between two lines
- Prev by Date: Re: get all lines between two lines
- Next by Date: Re: get all lines between two lines
- Previous by thread: Re: get all lines between two lines
- Next by thread: Re: get all lines between two lines
- Index(es):
Relevant Pages
|