chandantul has asked for the wisdom of the Perl Monks concerning the following question:
I was not able to compare 2 sepearate columns exists in 2 separate sheets, need your help to identify the mistake in my code
for my $worksheet1 ( $workbook1->worksheets() ) { $worksheet->write(0, 0, 'AD Match' , $my_format); $worksheet->write(0, 1, 'APP STATUS' , + $my_format); $worksheet->write(0, 2, 'APP LABEL' , +$my_format); my $appssheet = $worksheet1->get_name(); print "APP Sheet name: $appssheet . \n"; my ( $row_min, $row_max ) = $worksheet1->row_range(); my ( $col_min, $col_max ) = $worksheet1->col_range(); for $row ( $row_min .. $row_max ) { for my $col ( $col_min = 0) { if ( $appssheet eq $appsshhetname ) { my $cell = $worksheet1->get_cell( $row, 0 ); next unless $cell; $cellA = $cell->value(); #$cellA =~ s/@(.*)//g; $cellA =~ s/@(AD.ABC.COM)//g; if ( $cellA=~ /(\d{9})/ ) { push @cellA, $cellA; #print "DUMP: @cellA"; } } #print "$cellA \n"; } } %params = map { $_ => 1 } @cellA; print Dumper %params; if ( $appssheet eq $ADdata ) { for my $row1 ( $row_min .. $row_max ) { for my $col1 ( $col_min = 0) { my $cellB = $worksheet1->get_cell( $row1, 0 ); next unless $cellB; $cellC = $cellB->value(); #$cellC =~ s/@(AD.ABC.COM)//g; print "2nd Entry :$cellC\n"; #push @cellC , $cellC; if(exists($params{$cellC})) { $worksheet->write($r, 0, $cellC); } } } $r += 1; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unable to compare 2 arrays from 2 separate columns of separate sheets.
by GrandFather (Saint) on Feb 09, 2021 at 04:03 UTC | |
Re: Unable to compare 2 arrays from 2 separate columns of separate sheets.
by choroba (Cardinal) on Feb 09, 2021 at 09:11 UTC | |
by chandantul (Scribe) on Feb 09, 2021 at 17:53 UTC | |
by choroba (Cardinal) on Feb 09, 2021 at 20:05 UTC | |
by chandantul (Scribe) on Feb 10, 2021 at 05:18 UTC | |
by chandantul (Scribe) on Feb 11, 2021 at 16:45 UTC |
Back to
Seekers of Perl Wisdom