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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting messages from a log file

Status
Not open for further replies.

codebreak

Technical User
Oct 21, 2004
1
SE
In a log file I want to pick the messages out that starts with SXSN74 and ends with ;=>
The problem is that the line dosen't start with SXSN74 and the end of the message is on the next row.

So I want to pick all characters in between the SXSN74 and the ;=> and not getting the information before the SXSN74

Regards
/C
 
See thread822-939009

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant.
 
Something like this ?
sed -n '/SXSN74/,/;=>/{;s!.*SXSN74!SXSN74!;s!;=>.*!;=>!;p;}' /path/to/logfile

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top