Afficher un message
Vieux 31/10/2007, 15h53   #8
Miguel Lobos
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Combine multiple line segment into one, when certain pattern is found - awk/sed/perl

I'm looking to do something similar, but I'm not up to snuff enough on
awk or perl to figure it out on my own yet.

Anyway, I'm looking to match a particular string in a line, then grab
this line
and the next 5 after it so I can parse out some other parameters.
Here's a sample of what
I need to pull out of the file (matching on 'GHLR665', then pulling
this line plus the next 5):

1193616363 XXXXXX46D00 CM GHLR665 OCT28 18:59:54 7090 INFO
Table GHLRVLR Resource Limitation
1193616363 Operation: Update Location
1193616363 VLR number: 551178313920
1193616363 Description: Table GHLRVLR is about to
reach its 6000 Maximum Capacity.
1193616363 Space Left: 0 (6000)
1193616363 Action: Use QVLRACT in HLRADMIN to
identify the inactive VLRs.

Every line in this log file starts with a 10 digit number (i.e.
1193616363), which may or may not be the same value.
The line before and after what I'm trying to capture and write into a
single line / record will be just the 10 digit number,
followed by some white space character and a carriage return (UNIX
style, I think).

Any suggestions would be very much appreciated!

Mike

  Réponse avec citation
 
Page generated in 0,04684 seconds with 9 queries