Hi,
I'm new to perl.
I want to compare two excel sheets the second excel file is just the revised version of the first one. There are only two columns each file with a certain number of Rows
The following code is just printing all the values in it
I'm new to perl.
I want to compare two excel sheets the second excel file is just the revised version of the first one. There are only two columns each file with a certain number of Rows
The following code is just printing all the values in it
Code:
use strict;
use warnings;
use Spreadsheet::ParseExcel;
use Spreadsheet::WriteExcel;
my $parser = Spreadsheet::ParseExcel->new();
my $workbook = $parser->parse('C:\\perl\\Data dictionary\\first.xls');
print $workbook ,"\n";
my $parser1 = Spreadsheet::ParseExcel->new();
my $workbook1 = $parser->parse('C:\\perl\\Data dictionary\\second.xls');
print $workbook ,"\n";
print $workbook1 ,"\n";
if ( !defined $workbook ) {
die $parser->error(), ".\n";
}
for my $worksheet ( $workbook1->worksheets())
{
my ( $row_min, $row_max ) = $worksheet->row_range();
my ( $col_min, $col_max ) = $worksheet->col_range();
for my $worksheet ( $workbook->worksheets())
{
my ( $row_min, $row_max ) = $worksheet->row_range();
my ( $col_min, $col_max ) = $worksheet->col_range();
for my $row ( $row_min .. $row_max ) {
for my $col ( $col_min .. $col_max ) {
my $cell = $worksheet->get_cell( $row, $col );
my $cell1 = $worksheet->get_cell( $row, $col );
next unless $cell and $cell1;
my $data = $cell->value();
#print $data;
my $search = $cell1->value();
print $search;
}
}
}
}
Comment