Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Specifying Individual Sheets Using Spreadsheet::ParseExcel

by finhagen (Sexton)
on Oct 18, 2008 at 16:08 UTC ( #717958=perlquestion: print w/replies, xml ) Need Help??
finhagen has asked for the wisdom of the Perl Monks concerning the following question:

Thanks to the generous assistance of the wise perl monks I am enjoying success parsing excel spreadsheets with perl. However, there is one issue I have not been able to address on my own. The script I borrowed and modified uses an array to capture and iterate through the tabs in the Excel Workbook
foreach my $sheet (@{$workbook->{Worksheet}})
That works fine, but in some cases I would prefer to have the ability to to specify just one tab/sheet to parse. I have looked through the documentation but can't find an example of the code I am seeking. I have also tried a couple of code snippits to provide that granularity
my $sheet ={$workbook->{Worksheet[0]}}
but they error out during the compile. Can someone help me with the correct syntax to pick the specific sheet/tab within the Excel Workbook? Thanks so much.

Hagen Finley

Boulder, CO

Replies are listed 'Best First'.
Re: Specifying Individual Sheets Using Spreadsheet::ParseExcel
by jethro (Monsignor) on Oct 18, 2008 at 16:21 UTC
    my $sheet =$workbook->{Worksheet}[0] does what you want

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://717958]
Approved by jethro
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2016-10-25 05:16 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (315 votes). Check out past polls.