I am performing in an awk script a series of aggregations from a dataset and I get the following.
Now I would like to create an html that collects this previous output in the form of a table and that also makes a bar graph taking into account the values of a, b, c. I want the code for the html to be in this script too.
UPDATE SAMPLE OF THE DATASET TO GENERATE AGGREGATIONS
Bel,BLR,897,965322,6844,102217,725,
Bel,BEL,976,3851048,30826,329772,
Ben,BEN,9765,26952,163,2126,13,
Bot,BWA,976,305526,2686,125488,1103,
Cabo,CPV,9865,55960,401,98772,708,
UPDATE AGGREGATED_DATA OUTPUT
7,5.23,6.36,0.63
6,12.56,24.64,0.53
9,0.63,32.8,3.35
My script is as follows:
END {
print "<html><body>"
print "<table border=1>"
} NR == 1 {
print "<tr>"
print "<td><font face=verdana size=2 color=black>" $k "</font></td>"
print "<td><font face=verdana size=2 color=black>" $c "</font></td>"
print "<td><font face=verdana size=2 color=black>" $a "</font></td>"
print "<td><font face=verdana size=2 color=black>" $aa "</font></td>"
print "<td><font face=verdana size=2 color=black>" $aaa "</font></td>"
print "</tr>"
} NR > 1 {
print "<tr>"
print "<td><font face=verdana size=1>" $1 "</font></td>"
print "<td><font face=verdana size=1>" $2 "</font></td>"
print "<td><font face=verdana size=1>" $3 "</font></td>"
print "</tr>"
} END {
print "</table>"
print "</body></html>"
}
> file.html
Any way to achieve this?