Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Iterating Through Cell Blocks with Spreadsheet::Read

by Hammer2001 (Novice)
on Oct 08, 2013 at 18:04 UTC ( #1057445=note: print w/ replies, xml ) Need Help??


in reply to Re: Iterating Through Cell Blocks with Spreadsheet::Read
in thread Iterating Through Cell Blocks with Spreadsheet::Read

Thanks you for your reply, toolic. I still get the same error "Use of uninitialized value in concatenation (.) or string at..." on the print statement after replacing lines like "$name = $sheet{"$_28"}" with "$name = $sheet{"${_}28"}". Any other thoughts? Regards, Hammer.


Comment on Re^2: Iterating Through Cell Blocks with Spreadsheet::Read
Re^3: Iterating Through Cell Blocks with Spreadsheet::Read
by chexmix (Hermit) on Oct 08, 2013 at 18:30 UTC
    I hate to post this because it sounds condescending -- I don't mean it that way, honest!

    You know you have to do this with all the lines where you have such a hash key (e.g. the ones with "_29", "_30", etc), right? Not just the _28 one.

    I've been trying to get toolic's suggestion to not work, here, and I haven't succeeded.

      Oh, sorry, I misread your post. Please ignore mine above. :(
        Yes indeed, chexmix, recommended change was made on all affected lines. Here's the revised test script:
        use Spreadsheet::Read; my $inbook = "Data_File.xlsx"; $book = ReadData ($inbook); my @x = qw(F G H I J K); for my $sheet_index (1 .. $sheet_count) { my $sheet = $book->[$sheet_index] or next; foreach (@x) { $name = $sheet{"${_}28"}; $strain = $sheet{"${_}29"}; $initdensity = $sheet{"${_}30"}; $finaldensity = $sheet{"${_}31"}; $avedensity = $sheet{"${_}32"}; print "Found sheet with label: $sheet{label}\n"; print "COL=$_ $name $strain $initdensity $finaldensity $avedens +ity\n"; } }
        Hopefully it helps you see my error. Regards, Hammer

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2015-07-03 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (48 votes), past polls