#!perl -w
use HTML::TableExtract qw(tree);
use File::Slurp qw( :all ) ;
$date = '02-25-2013';
$Path = 'C://path//to//File.htm';
$html_string = read_file($Path);
my $tree2 = HTML::TableExtract->new(
keep_html => 1,
headers => [qw(NSN)],
slice_columns => 0,
keep_headers => 0,
gridmap => 0,
strip_html_on_match => 1,
debug => 1,
decode => 1
);
$tree2->parse($html_string);
$table1 = $tree2->first_table_found;
my @rows = $table1->rows;
my $row_cnt = @rows;
print "$row_cnt rows found \n";
my $cell1;
my $i = 1; # row number, skip the header row
print "start the row loop \n";
while ($i < $row_cnt ) {
print "checking date in cell 9 in row: $i \n";
my $cell1 = $table1->cell($i, 9); #row $i, column 9
print "cell1 --> $cell1 \n";
next if $cell1 !~ /$date/; # not today
#
# there is more code that does not
# appear here to save some data from the row
# to a file
#
}
continue {
$i++;
}