We receive this large file which is generated as a HTML page.
So anybody can view it with a web brower.
A few lines from this file ...
Code:
<tr><td><font color="#555555" size="3" face="Tahoma, Arial, Verdana, Helvetica"> 1999 <font color="#cc6600" size="5">←</font> <font color="#0066ff" size="4">03</font>-27 23:36:50 → <font color="#9932cc" size="2">left</font> → <font color="#800000"> Stub:</font> <font color="#0066ff" size="2">star</font><font color="#bb6633" size="2"> start</font> Block to negative <font color="#228b22" size="3"> Orange </font> </font></td></tr>
<tr><td><font color="#555555" size="3" face="Tahoma, Arial, Verdana, Helvetica"> 1998 <font color="#cc6600" size="5">←</font> <font color="#0066ff" size="4">03</font>-27 23:36:48 → <font color="#9932cc" size="2">right</font> → <font color="#800000"> Stub:</font> <font color="#0066ff" size="2">star</font><font color="#9933cc" size="2"> return</font> from negative <font color="#228b22" size="3"> Green </font> </font></td></tr>
<tr><td><font color="#555555" size="3" face="Tahoma, Arial, Verdana, Helvetica"> 1997 <font color="#cc6600" size="5">←</font> <font color="#0066ff" size="4">03</font>-27 23:36:46 → <font color="#9932cc" size="2">up</font> → <font color="#800000"> Stub:</font> <font color="#0066ff" size="2">star</font><font color="#9933cc" size="2"> return</font> from negative <font color="#228b22" size="3"> Yellow </font> </font></td></tr>
Note:
Each <tr><td> ... </td></tr> is on a single line.
This file has hundreds of lines.
We need to make a small change to this file so it is easier to read.
If the <tr><td> ... </td></tr> line has the word "Yellow" then
we want to replace the '<td>' tag
with '<td bgcolor="#FFFF00">'
so that the line with with word "Yellow" has a yellow background.
How can I do this with a bash shell script?
I can add the shell script to the cron job that delivers this HTML file.