#!/bin/
linuxjishu/13830.html target=_blank class=infotextkey>awk -f
BEGIN {
# 定义每个颜色区域的开始字段及其颜色,以下表示的意思是 1-3 是red, 4-5是yellow, 6-末尾是blue
ffmt = "1,4,6";
cfmt = "red,yellow,blue";
split(ffmt, field, ",");
split(cfmt, color, ",");
print "<html>";
print "<head><title> message </title></head>";
print "<body>";
print "<table border=0>";
}
{
print "<tr>";
m = 1;
for (i=1; i<=NF; i++) {
if (i == field[m]) {
if (i != field[1]) print "</font></td>";
printf "<td><font color=" color[m] ">";
m++;
}
printf "%s ", $i;
}
print "</font></td>";
print "</tr>";
}
END {
print "</table>";
print "</body>";
print "</html>";
}