If the output is a single line per printer you can use my previous example, otherwise there might be some work involved :)
Update:if the output is something along the lines of
name display toner level ----------------------------------- printer1 toner low 25% printer2 toner low 1% printer3 etc etc etc
#!/usr/bin/perl -w use strict; use CGI; my $main=new CGI; print $main->header; print $main->start_html("Printer Status"); open(STATUSFILE," your_outfile") || die "Cannot open logfile!: $!\n"; while(<STATUSFILE>) { chomp; if (! ($_=~ /-----------------------------------/)) { #my ($printer,$display,$toner,$level) = split(/ /, $_) +; my @status = split(/ /, $_); if (($status[0] eq "name") && ($status[1] eq "display" +)) { print "<center><table width=250 border=1><tr a +lign=center>\n"; for (@status) { print "<td><b>$_</b></td>\n"; } print "</tr>\n"; } else { for (@status) { print "<td>$_</td>\n"; } print "</tr>\n"; } } } print "</table>\n"; close(STATUSFILE); exit;
In reply to Re: Re: Re: Unix Perl and Html
by thatguy
in thread Unix Perl and Html
by meccaxlr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |