in reply to Re^4: Searching a string in excel sheets
in thread Searching a string in excel sheets
Date formats can be a problem with Excel, you might need to convert to match properly
poj#!perl use strict; use Spreadsheet::XLSX; use Spreadsheet::ParseExcel::Utility qw(ExcelFmt); my $col1 = 1; # B my $col2 = 35; # AJ my $wb = Spreadsheet::XLSX->new ('c://temp//Book1.xlsx'); my $ws = $wb->Worksheet('Sheet1'); foreach my $row ($ws->{MinRow} .. $ws->{MaxRow}) { # column B my $c1 = $ws->get_cell($row,$col1); my $ymd = ExcelFmt('yyyy-mm-dd', $c1->unformatted) if defined $c1;; # column AJ my $c2 = $ws->get_cell($row,$col2); my $value = $c2->value if defined $c2; print "$row $ymd $value\n"; }
|
|---|