#!/usr/bin/perl use strict; use warnings; #use diagnostics; use HTML::TableExtract; use Text::Table; ##my $sched = qr/Schedule Name|Node Name/; my $html = "c:\\Testin.htm"; my $out = "c:\\Testout.csv"; open( my $ofh, ">", $out ) or die "oops" ; my $headers = [ 'Status', 'Results', 'Schedule Name']; my $table_extract = HTML::TableExtract->new(headers => $headers); my $table_output = Text::Table->new(); $table_extract->parse_file($html); my ($table) = $table_extract->tables or die "no emails to process\n"; foreach my $row ($table->rows) { $table_output->load($row); print " ", join(',',grep defined, @$row), "\n"; print $ofh " ", join(',',grep defined, @$row ), "\n"; } $headers = [ 'Status', 'Results', 'Node Name']; $table_extract = HTML::TableExtract->new(headers => $headers); $table_output = Text::Table->new(); $table_extract->parse_file($html); ($table) = $table_extract->tables; foreach my $row ($table->rows) { $table_output->load($row); print " ", join(',',grep defined, @$row),"\n"; print $ofh " ", join(',',grep defined, @$row), "\n"; }