Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
No such thing as a small change
 
PerlMonks  

Re: new dilemma on the same song that remains... umm the same

by poj (Curate)
on Jun 02, 2012 at 08:24 UTC ( #973953=note: print w/ replies, xml ) Need Help??


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


Comment on Re: new dilemma on the same song that remains... umm the same
Download Code
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://973953]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (16)
As of 2014-04-16 15:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (432 votes), past polls