I need some help making this script... so far I think it should look something like this (I tend to use AWK a lot)
#!/usr/bin/perl -w
@filelist=(
file1,
file2,
file3
)
print ("<html>");
foreach $filelist {
print ("<table>";
print ("<td>"$filelist"</td>")
foreach [line in the file]
print ("<td>"$1, $2"</td>");
}
print ("</table>";
}
print ("</html>");
So I want the script to go to each file, print the filename, and then for each line print two strins in a <td>
Am I on the right track?
Also, I realised the AWK I wrote needed a couple of IF statements - I believe it should look like this
while(<F_IN>) {
if ($1>=2) {
print "<td class=\"green\" title=\""$1,$2"\">"
}
if ($1>=1) {
print "<td class=\"amber\" title=\""$1,$2"\">"
}
if ($1>=0) {
print "<td class=\"red\" title=\""$1,$2"\">"
}