Please help!!
This code works perfect but the only problem I am having is that is treats eg SQL Developer as separate cell/column which makes the formatting bad. I want to put SQL Developer in one cell. I attached a sample of how the output looks like.
report.txt
USERNAME OSUSER MACHINE PROGRAM COUNT(*)
-------------------- ------------ -------------------- ------------------------- ----------
xxxxxxx xxxxxxx xxxxxxx Toad.exe 5
xxxxxxx xxxxxxx xxxxxxx SQL Developer 4
awk ' BEGIN {
print "From: from@x.com"
print "To: to@x.com"
print "MIME-Version: 1.0"
print "Content-Type: text/html"
print "Subject: Your Subject"
print "<html><body><table border=1 cellspacing=2 cellpadding=3>"
print "<tr>"
print "</tr>"
} {
print "<tr>"
print "<td>"$1"</td>";
print "<td>"$2"</td>";
print "<td>"$3"</td>";
print "<td>"$4"</td>";
print "<td>"$5"</td>";
print "</tr>"
} END {
print "</table></body></html>"
} ' report.txt | sendmail -t