Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

Comment on Specifying Individual Sheets Using Spreadsheet::ParseExcel
Select or Download Code
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2015-07-05 13:28 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 (67 votes), past polls