Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2018-02-19 06:48 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (259 votes). Check out past polls.