Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing fields from multiple lines ?

Status
Not open for further replies.

hg4372

Technical User
Feb 9, 2009
43
US
I have logs being captured to a file. The log format is the same for all of them. In the below example the ALL_SAME,B,C,D, and E are the fields I want to parse, however the fields B,C,D, and E are not always the same. Could someone please point me in the right direction on what would be the best way to parse these out.

ALL_SAME ------ BBBBB BB:BB:BB ---- ---- ----
--- CCCCCCCCCCCCCCCC CCCC
--------- --- = DDDD ------ -- = EEEEEEEEEE
------- ---- ----
etc....

I would like the output to redirect to a different file something like this.

ALL_SAME BBBBB BB:BB:BB CCCCCCCCCC CCCC DDDD EEEEEEEEEE

Sorry if I didn't explain this right. This is my first time trying to parse something.

Please Help.
 

True, you didn't explain this right.

First you need to post example data formatted using the "code" tags. Click on the 'Process TGML' below and check out the 'CODE' section.

Then based on the example data you need to provide the expected results.
[3eyes]




----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top