You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Ian <ia...@isasports.com> on 2001/11/29 23:31:16 UTC

Perl and Microsoft Excel?

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In the wide and wonderful world of Microsoft and Linux, I'm in the
need of an interesting soloution.

I'm presenting this to the list because I've ran out of good ideas.

The campus phone system has a 911 database that is in Microsoft Excel
format, and they want to be able to take that information, and show
it on a webpage, either via a search form, or in one big table.  The
problem is, they want to do it dynamically...the web server needs to
yank it down from a samba share (or ftp), parse it, show it, and
terminate.  

I'm really **really** new at anything perl wise...so I haven't the
foggiest clue as to where I should start.  

I've finally gotten Apache/Mod Perl/Mod SSL installed, and working
properly.  Are there any modules for pulling information from an
excel sheet?  How about modules that keep the overworked admin from
insanity?

Ian


- ----
- From RFC 1925: "(3)  With sufficient thrust, pigs fly just fine.
However, this is not necessarily a good idea. It is hard to be sure
where they are going to land, and it could be dangerous sitting under
them as they fly overhead."


-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPAa3NHRiiq+WL4fKEQKsRACgutpROPjPllax3Nvfat2R7YERlSQAn35Q
0vwYEFLgdzsz4Dfu98dUJzBy
=Qs9B
-----END PGP SIGNATURE-----


Re: Perl and Microsoft Excel?

Posted by Robin Berjon <ro...@knowscape.com>.
On Thursday 29 November 2001 23:31, Ian wrote:
> In the wide and wonderful world of Microsoft and Linux, I'm in the
> need of an interesting soloution.
>
> The campus phone system has a 911 database that is in Microsoft Excel
> format, and they want to be able to take that information, and show
> it on a webpage, either via a search form, or in one big table.  The
> problem is, they want to do it dynamically...the web server needs to
> yank it down from a samba share (or ftp), parse it, show it, and
> terminate.

Another option than those that have been presented here would be to use 
XML::SAXDriver::Excel. It is imho superior to using some of the modules that 
parse Excel directly because it is SAX based. That means that you have a lot 
more power in your hands, and that if your data source move to something else 
(eg CSV, database, etc...) you'll be able to use nearly the same code. 
Furthermore, SAX is a simple, flexible, well-thought out, and well-documented 
API.

-- 
_______________________________________________________________________
Robin Berjon <ro...@knowscape.com> -- CTO
k n o w s c a p e : // venture knowledge agency www.knowscape.com
-----------------------------------------------------------------------
Paranoids are people, too; they have their own problems.  It's easy
to criticize, but if everybody hated you, you'd be paranoid too.


OT: Re: Perl and Microsoft Excel?

Posted by ___cliff rayman___ <cl...@genwax.com>.
fyi - this is off topic since it does not have anything to do with
mod_perl in particular.  you should really ask on:
news://comp.lang.perl.modules

or one of the other newsgroups:
news://comp.lang.perl.moderated
news://comp.lang.perl.misc

or on this helpful website:
http://www.perlmonks.org/

when you ask a question like "are there any modules", think
http://search.cpan.org/

one of the best things about perl, is this site and the well organized
set of modules that exist on it.

a simple search for 'excel' brought up this likely candidate for your use:
http://search.cpan.org/doc/KWITKNR/Spreadsheet-ParseExcel-0.2403/ParseExcel.pm

good luck and enjoy perl!
cliff

Ian wrote:

> The campus phone system has a 911 database that is in Microsoft Excel
> format, and they want to be able to take that information, and show
> it on a webpage, either via a search form, or in one big table.  The
> problem is, they want to do it dynamically...the web server needs to
> yank it down from a samba share (or ftp), parse it, show it, and
> terminate.
>
> I'm really **really** new at anything perl wise...so I haven't the
> foggiest clue as to where I should start.
>
> I've finally gotten Apache/Mod Perl/Mod SSL installed, and working
> properly.  Are there any modules for pulling information from an
> excel sheet?  How about modules that keep the overworked admin from
> insanity?

--
___cliff rayman___cliff@genwax.com___http://www.genwax.com/



Re: Perl and Microsoft Excel?

Posted by John Whitnack <jw...@glja.com>.
Ian,

I have never used it, but I have heard that Spreadsheet::ParseExcel is
good at getting Excel file into a Perl script. If you every need to
go the other way (Perl->Excel) i have used (and highly recommend) 
Spreadsheet::WriteExcel. Both of these can be found on CPAN.

Ian wrote:
> The campus phone system has a 911 database that is in Microsoft Excel
> format, and they want to be able to take that information, and show
> it on a webpage, either via a search form, or in one big table.  The
> problem is, they want to do it dynamically...the web server needs to
> yank it down from a samba share (or ftp), parse it, show it, and
> terminate.
> 

John Whitnack

Re: Perl and Microsoft Excel?

Posted by Hans Poo <ha...@integranet.cl>.
El Jue 29 Nov 2001 19:31, Ian escribió:
> Mensaje firmado por ID de clave desconocido 962F87CA
> In the wide and wonderful world of Microsoft and Linux, I'm in the
> need of an interesting soloution.
>
> I'm presenting this to the list because I've ran out of good ideas.

I recommend making a mod_perl application for the list and store the 
information in mysql (and forget about excel if you can), and then, just take 
that information and publish on the web. 

Hans

Re: Perl and Microsoft Excel?

Posted by David Kaufman <dk...@nac.net>.
"Tom Servo" <to...@cnw.com> wrote:
> On Thu, 29 Nov 2001, Ian wrote:
> > The campus phone system has a 911 database that is in Microsoft Excel
> > format, and they want to be able to take that information, and show
> > it on a webpage, either via a search form, or in one big table.  The
> > problem is, they want to do it dynamically...the web server needs to
> > yank it down from a samba share (or ftp), parse it, show it, and
> > terminate.
>
> [...]
> Hopefully someone else knows of a CPAN module to work with Excel files,
> though...

i count at least 5:
http://search.cpan.org/search?mode=module&query=Excel

i haven't used any of them, though.  i've used Spreadsheet::WriteExcel, but
it only *writes* Excel files, it doesn't read them (hence the name).

it looks like
    Spreadsheet::ParseExcel
    http://search.cpan.org/search?dist=Spreadsheet-ParseExcel

    or Spreadsheet::ParseExcel::Simple
    http://search.cpan.org/search?dist=Spreadsheet-ParseExcel-Simple

should do what you're looking for

hth,

-dave


Re: Perl and Microsoft Excel?

Posted by "J. Zobel" <nc...@netcologne.de>.
On Thu, 2001-11-29 at 23:37, Tom Servo wrote:
> There's probably a far better answer to this than I can give, but if not,
> an interim solution might be having whoever maintains these Excel files
> save them as .csv files.   Excel can do that, and while you lose all the
> fancy formatting, it just dumps them in a comma seperated list, then you
> can split on commas to get the values out of it.

Be careful, MScsv is not as simple as it seems. Fields containing , are
enclosed in "" - thats OK. But those ""-enclosed fields saved from Excel
can also contain linebreaks. 

Hth,
Joachim
 


Re: [OT] Perl and Microsoft Excel?

Posted by "Ken Y. Clark" <kc...@logsoft.com>.
On Thu, 29 Nov 2001, Tom Servo wrote:

> Date: Thu, 29 Nov 2001 14:37:34 -0800 (PST)
> From: Tom Servo <to...@cnw.com>
> To: Ian <ia...@isasports.com>
> Cc: modperl@apache.org
> Subject: Re: Perl and Microsoft Excel?
>
> There's probably a far better answer to this than I can give, but if not,
> an interim solution might be having whoever maintains these Excel files
> save them as .csv files.   Excel can do that, and while you lose all the
> fancy formatting, it just dumps them in a comma seperated list, then you
> can split on commas to get the values out of it.
>
> Hopefully someone else knows of a CPAN module to work with Excel files,
> though...
>
> ------------
> Brian Nilsen
> tomservo@cnw.com

Here's a sampling:

http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search?search=excel&new=Search&filetype=+distribution+name+or+description&join=and&arrange=file&download=auto&stem=no&case=clike&site=ftp.funet.fi&age=

ky

>
> On Thu, 29 Nov 2001, Ian wrote:
>
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > In the wide and wonderful world of Microsoft and Linux, I'm in the
> > need of an interesting soloution.
> >
> > I'm presenting this to the list because I've ran out of good ideas.
> >
> > The campus phone system has a 911 database that is in Microsoft Excel
> > format, and they want to be able to take that information, and show
> > it on a webpage, either via a search form, or in one big table.  The
> > problem is, they want to do it dynamically...the web server needs to
> > yank it down from a samba share (or ftp), parse it, show it, and
> > terminate.
> >
> > I'm really **really** new at anything perl wise...so I haven't the
> > foggiest clue as to where I should start.
> >
> > I've finally gotten Apache/Mod Perl/Mod SSL installed, and working
> > properly.  Are there any modules for pulling information from an
> > excel sheet?  How about modules that keep the overworked admin from
> > insanity?
> >
> > Ian
> >
> >
> > - ----
> > - From RFC 1925: "(3)  With sufficient thrust, pigs fly just fine.
> > However, this is not necessarily a good idea. It is hard to be sure
> > where they are going to land, and it could be dangerous sitting under
> > them as they fly overhead."
> >
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
> >
> > iQA/AwUBPAa3NHRiiq+WL4fKEQKsRACgutpROPjPllax3Nvfat2R7YERlSQAn35Q
> > 0vwYEFLgdzsz4Dfu98dUJzBy
> > =Qs9B
> > -----END PGP SIGNATURE-----
> >
> >


Re: Perl and Microsoft Excel?

Posted by Mark Fowler <ma...@twoshortplanks.com>.
On Thu, 29 Nov 2001, Tom Servo wrote:

> Hopefully someone else knows of a CPAN module to work with Excel files,
> though...

Spreadsheet::ParseExcel and Spreadsheet::WriteExcel?  Both have ::Simple 
versions too.

I've used them in the past and it's Worked For Me (tm)

Later.

Mark.

-- 
s''  Mark Fowler                                     London.pm   Bath.pm
     http://www.twoshortplanks.com/              mark@twoshortplanks.com
';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}


Re: Perl and Microsoft Excel?

Posted by Tom Servo <to...@cnw.com>.
There's probably a far better answer to this than I can give, but if not,
an interim solution might be having whoever maintains these Excel files
save them as .csv files.   Excel can do that, and while you lose all the
fancy formatting, it just dumps them in a comma seperated list, then you
can split on commas to get the values out of it.

Hopefully someone else knows of a CPAN module to work with Excel files,
though...

------------
Brian Nilsen
tomservo@cnw.com

On Thu, 29 Nov 2001, Ian wrote:

>  
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> In the wide and wonderful world of Microsoft and Linux, I'm in the
> need of an interesting soloution.
> 
> I'm presenting this to the list because I've ran out of good ideas.
> 
> The campus phone system has a 911 database that is in Microsoft Excel
> format, and they want to be able to take that information, and show
> it on a webpage, either via a search form, or in one big table.  The
> problem is, they want to do it dynamically...the web server needs to
> yank it down from a samba share (or ftp), parse it, show it, and
> terminate.  
> 
> I'm really **really** new at anything perl wise...so I haven't the
> foggiest clue as to where I should start.  
> 
> I've finally gotten Apache/Mod Perl/Mod SSL installed, and working
> properly.  Are there any modules for pulling information from an
> excel sheet?  How about modules that keep the overworked admin from
> insanity?
> 
> Ian
> 
> 
> - ----
> - From RFC 1925: "(3)  With sufficient thrust, pigs fly just fine.
> However, this is not necessarily a good idea. It is hard to be sure
> where they are going to land, and it could be dangerous sitting under
> them as they fly overhead."
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
> 
> iQA/AwUBPAa3NHRiiq+WL4fKEQKsRACgutpROPjPllax3Nvfat2R7YERlSQAn35Q
> 0vwYEFLgdzsz4Dfu98dUJzBy
> =Qs9B
> -----END PGP SIGNATURE-----
> 
> 


Re: Perl and Microsoft Excel?

Posted by Medi Montaseri <me...@CyberShell.com>.
Two suggestions:

One: drop the excel idea right now or you'll find out its not the right
solution at a later time. Use LDAP instead. Then right a CGI (as you
really don't need Mod-Perl) for all kinds of queries and an admin view
for a maintainer to maintain it.

Two: ask your spreadsheet maintainer to save the sheet in CSV (Comma
Seperated Value) format someplace where a CGI can access it. Say

www:/home/directory/list.csv

Then use Samba and on the maintainer's windows machine have a network
mapped drive, where this file will be saved as, say z:\list.csv, where
z: is mapped to \\www\directory

Then use Text::CSV.pm perl package to access this list.csv

You are done....go home now..

PS: you might have to convert the '\r\n' to '\n' as samba does not
change the line break symbols as it moves it from Windows to Unix.

Cheers...

On Thu, 29 Nov 2001, Ian wrote:

>  
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> In the wide and wonderful world of Microsoft and Linux, I'm in the
> need of an interesting soloution.
> 
> I'm presenting this to the list because I've ran out of good ideas.
> 
> The campus phone system has a 911 database that is in Microsoft Excel
> format, and they want to be able to take that information, and show
> it on a webpage, either via a search form, or in one big table.  The
> problem is, they want to do it dynamically...the web server needs to
> yank it down from a samba share (or ftp), parse it, show it, and
> terminate.  
> 
> I'm really **really** new at anything perl wise...so I haven't the
> foggiest clue as to where I should start.  
> 
> I've finally gotten Apache/Mod Perl/Mod SSL installed, and working
> properly.  Are there any modules for pulling information from an
> excel sheet?  How about modules that keep the overworked admin from
> insanity?
> 
> Ian
> 
> 
> - ----
> - From RFC 1925: "(3)  With sufficient thrust, pigs fly just fine.
> However, this is not necessarily a good idea. It is hard to be sure
> where they are going to land, and it could be dangerous sitting under
> them as they fly overhead."
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
> 
> iQA/AwUBPAa3NHRiiq+WL4fKEQKsRACgutpROPjPllax3Nvfat2R7YERlSQAn35Q
> 0vwYEFLgdzsz4Dfu98dUJzBy
> =Qs9B
> -----END PGP SIGNATURE-----
> 
> 

-- 
-------------------------------------------------------------------------
Medi Montaseri                               medi@CyberShell.com
Unix Distributed Systems Engineer            HTTP://www.CyberShell.com
CyberShell Engineering
-------------------------------------------------------------------------