Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: parsing an excel spreadsheet into a SQL insert statement

by Albannach (Monsignor)
on Apr 05, 2001 at 21:16 UTC ( [id://70170]=note: print w/replies, xml ) Need Help??


in reply to parsing an excel spreadsheet into a SQL insert statement

Here's a good direction to start in: Spreadsheet::ParseExcel.

For future reference, the CPAN nodelet is great - type "excel", hit the button and you get the above module.

--
I'd like to be able to assign to an luser

Replies are listed 'Best First'.
Re: Re: parsing an excel spreadsheet into a SQL insert statement
by JSchmitz (Canon) on Apr 05, 2001 at 22:38 UTC
    Cool thanks - problem solved - this is exactly what I needed
    use strict; use Spreadsheet::ParseExcel; my $oExcel = new Spreadsheet::ParseExcel; #1.1 Normal Excel97 my $oBook = $oExcel->Parse('Excel/Test97.xls'); my($iR, $iC, $oWkS, $oWkC); print "FILE :", $oBook->{File} , "\n"; print "COUNT :", $oBook->{SheetCount} , "\n"; print "AUTHOR:", $oBook->{Author} , "\n"; for(my $iSheet=0; $iSheet < $oBook->{SheetCount} ; $iSheet++) { $oWkS = $oBook->{Worksheet}[$iSheet]; print "--------- SHEET:", $oWkS->{Name}, "\n"; for(my $iR = $oWkS->{MinRow} ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $i +R++) { for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{ +MaxCol} ; $iC++) { $oWkC = $oWkS->{Cells}[$iR][$iC]; print "( $iR , $iC ) =>", $oWkC->Value, "\n" if($oWkC) +; } } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-03-29 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found