in reply to new dilemma on the same song that remains... umm the same

As chromatic said you need two separate loops , one for each column
#!/usr/bin/perl use strict; use Spreadsheet::XLSX; my $excel = Spreadsheet::XLSX -> new ('build.xlsx'); my $sheet = $excel->Worksheet('Sheet1'); my ($row_min,$row_max) = $sheet->row_range(); # scan col D and store values my %colD=(); for my $row ($row_min..$row_max){ my $valD = $sheet->{Cells}[$row][3]->{Val}; $colD{$valD} = $row+1; # excel row number } # scan col A starting at row 2 open FILE,'>','feckyou.txt' or die $!; for my $row (1..$row_max){ my $valA = $sheet->{Cells}[$row][0]->{Val}; # does this value exist in Col D if (exists $colD{$valA}) { my $xlrow = $row+1; print FILE "price change [A$xlrow]=[D$colD{$valA}] Value=$valA\n"; } }
poj

Replies are listed 'Best First'.
Re^2: new dilemma on the same song that remains... umm the same
by trickyq (Acolyte) on Jun 03, 2012 at 02:31 UTC

    once again with minimal tweaking, its perfect

    thanks