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!

sed - Add HTML tags to some lines

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Feb 6, 2002
1,851
IL
HI,

I'd like to paint only lines containing a string "Exception" into red.
Original line :
Exception in MHstatus_t::getMessage()

Painted line:
<font color="ff0000">Exception in MHstatus_t::getMessage()</font>

Please advise on a sed syntax.
Thanks

Long live king Moshiach !
 
sed '/Exception/s!\(.*\)!<font color="ff0000">\1</font>!' /path/to/input > output

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

Part and Inventory Search

Sponsor

Back
Top