excel to csv

J

J. Gleixner

Josh said:
hi all

anybody knows a script to save an excel in csv?

i need it for a php script
Then why ask in a perl newsgroup? If you want a PHP answer, try a PHP
newsgroup.
 
J

James Willmore

anybody knows a script to save an excel in csv?

i need it for a php script

If you need this for a PHP script, then wht not post to a PHP group?
Why are you mixing languages? This is an annoying pet peeve I have.

My suggestion is pick one and stick with it's functionality. I
believe this has been done successfully in both languages - pick one.

If you still have a burning desire or some company restriction that
requires you to write in Perl for this task, have a look at the
Spreadsheet::WriteExcel module. This should do what you're asking to
do.

HTH

Jim
 
J

James Willmore

anybody knows a script to save an excel in csv?

i need it for a php script

If you need this for a PHP script, then wht not post to a PHP group?
Why are you mixing languages? This is an annoying pet peeve I have.

My suggestion is pick one and stick with it's functionality. I
believe this has been done successfully in both languages - pick one.

If you still have a burning desire or some company restriction that
requires you to write in Perl for this task, have a look at the
Spreadsheet::WriteExcel module. This should do what you're asking to
do.

HTH

Jim
 
E

Eric J. Roode

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

i need a perl script to save an excel in csv

Perhaps Visual Basic, or VBA, would be a better tool for doing this? Why
do you have your heart set on Perl?

- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print

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

iQA/AwUBP0E9LmPeouIeTNHoEQKqRgCfanTcjHrwN0Slmef16m63YN5TL/8An2II
jIJqdJCdyjJwzHp57FzMjcnq
=nRhz
-----END PGP SIGNATURE-----
 
M

Matt Garrish

James Willmore said:
My suggestion is pick one and stick with it's functionality. I
believe this has been done successfully in both languages - pick one.

If you still have a burning desire or some company restriction that
requires you to write in Perl for this task, have a look at the
Spreadsheet::WriteExcel module. This should do what you're asking to
do.

You're going in the wrong direction. The OP wants excel -> csv not csv ->
excel. The Spreadsheet::WriteExcel module won't help for the latter.
Assuming you're on a Windows machine and you have Excel installed, you might
be able to use the Win32::OLE module to open the file in Excel and then use
Excel itself to save the file to csv (from a simple macro:
ActiveWorkbook.SaveAs FileName:="C:\test.csv", FileFormat:=xlCSV).

Matt


Matt
 
C

ctcgag

Josh said:
hi all

anybody knows a script to save an excel in csv?

perldoc Spreadsheet::parseExcel
gives a script on the first page that should be readily adaptable
to your need.
i need it for a php script

What difference does it make what script you need it for?

Xho
 
J

James Willmore

Matt Garrish said:
You're going in the wrong direction. The OP wants excel -> csv not csv ->
excel. The Spreadsheet::WriteExcel module won't help for the latter.
Assuming you're on a Windows machine and you have Excel installed, you might
be able to use the Win32::OLE module to open the file in Excel and then use
Excel itself to save the file to csv (from a simple macro:
ActiveWorkbook.SaveAs FileName:="C:\test.csv", FileFormat:=xlCSV).

Spreadsheet::parseExcel is what I meant :(
I agree that, if on a WIN32 platform, Win32::OLE is more the way to go.
I just wanted to suggest a portable option.
Both should work fine.

Half asleep.

Jim
 
J

Josh

Matt Garrish said:
You're going in the wrong direction. The OP wants excel -> csv not csv ->
excel. The Spreadsheet::WriteExcel module won't help for the latter.
Assuming you're on a Windows machine and you have Excel installed, you might
be able to use the Win32::OLE module to open the file in Excel and then use
Excel itself to save the file to csv (from a simple macro:
ActiveWorkbook.SaveAs FileName:="C:\test.csv", FileFormat:=xlCSV).

i'm sorry... i'm working on a linux server
 
J

Josh

perldoc Spreadsheet::parseExcel
gives a script on the first page that should be readily adaptable
to your need.

very good this is ok ;)
What difference does it make what script you need it for?

in my php script i download the zipped excel from a server...
then i extract the excel and save it on the server... now i can't read the
excel... i need some tool that convert excel in csv
 
G

Garry Short

J

Josh

Eric J. Roode said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Why don't you explain what you're trying to do, in some detail, right from
the start, rather than doling out hints one at a time? Several people have
already posted useful suggestions, and to each one, you give a one-sentence
response along the lines of "That won't work, because x."

Explain your complete problem. Now. Or you're not going to get much more
help from anyone.

ok... i need to parse an excel file that i downloaded automatically from a
remote server
i'm working on a linux server so i can't use some php's objects that run
only on windows systems
i can't use an odbc connection because my server don't support this
so i would convert this excel in a csv file to parse it with php... i can do
this calling a perl script (that convert a xls in csv) by my php script and
then parse the csv with php...
 
G

Garry Short

Josh wrote:


So what? So am I.

This script was written on my laptop, which runs SuSE 8.1. One of the main
ideas behind Perl is that it's supposed to be *PORTABLE!*

In fact, I just went back and read the link I posted - it specifically says
I'm running Linux, and the OP specifically said in response that she was
running RedHat 8.

If you're going to ask for help, how about at least reading the information
you're pointed at?

Regards,

Garry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,129
Messages
2,570,770
Members
47,329
Latest member
FidelRauch

Latest Threads

Top