Hi All,
We have Redhat 6.5 server. I am preparing a shell script to get a html output.
The text file contains 7 lines with heading.
File Name : Memory.txt
Memory-Type Size-GB
Total-Memory 55GB
Used-Memory 50GB
Free-Memory 5GB
etc.....
I am preparing a script to get a html output based on the about data ( Memory.txt )
The below Command use to generate a html file
awk'
BEGIN{
print "<html> \n <body> \n <tabel cellpadding="10" border="1">
Print "<h5> Memory Details </h5>
}
{
print "<tr>"
for(i=1;i<=NF;i++)
print "<td>" $i "</td>"
print "</tr>"
}
End{
print "\n</table> /n<body> /n <html>"
} Memory.txt > test.html
With the help of the above command,i can get the html output.But unable to change the column header font size and its color.
I tried the below using multiple for loop but no luck.
awk'
BEGIN{
print "<html> \n <body> \n <tabel cellpadding="10" border="1">
Print "<h5> Memory Details </h5>
}
{
print "<tr>"
for(i=1;i<=NF;i++)
print "<td bgcolor=yellow>" $i "</td>"
print "</tr>"
}
{
print "<tr>"
for(j=1;j<=NF;j++)
print "<td>" $j "</td>"
print "</tr>"
}
i=0;
End{
print "\n</table> /n<body> /n <html>"
} Memory.txt > test.html
Is it possible to read data from a particular line ( second line ) for this scenario
Any suggestions.
Thanks,