Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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
[soonix]: when I read "Joda time format" I thought of "Yoda time format" e.g. ss:mm:HH dd MMM YYYY :-)

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2017-03-24 07:32 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (297 votes). Check out past polls.