Results 1 to 2 of 2
I want to go through a log file and find pattern1 and then a pattern2 only after pattern 1. e.g. I have this in my log file:
start time for ...
- 10-11-2010 #1Just Joined!
- Join Date
- Sep 2010
- Posts
- 12
find a pattern after a specific pattern
I want to go through a log file and find pattern1 and then a pattern2 only after pattern 1. e.g. I have this in my log file:
start time for the job: 12:50
.
.
.
howManyRecords: 2230
.
.
.
start time for the job: 13:30
.
.
.
howManyRecords: 1200
.
.
.
start time for the job: 14:10
.
.
.
howManyRecords: 1450
.
.
.
So for example I want to know howManyRecords was in 13:30.
I figured I grep for "start time for the job" and then only after that (and before the next occurence of that) grep for "howManyRecords". Is this a sane way?
Any better ideas to how go about this?
- 10-12-2010 #2Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 262


Reply With Quote
