In article <VAVEc.23764$DT5.8432@nwrddc03.gnilink.net>,
"Joshua Beall" <jbeall@donotspam.remove.me.heraldic.us> wrote:
[color=blue]
> Hi All,
>
> Up until now, I have been importing data from Excel spreadsheets into MySQL
> by exporting them to either .csv files, or tab-delimited .txt files, then
> using PHP scripts to insert each row. This works fine, but just adds
> another step (open xls, save as csv, then import into MySQL). I am
> wondering, has there been any work done on handling xls files, natively, in
> PHP? The files I work with are very simple; just rows of data divided into
> columns. No cells are calculated based on the value of other cells. It is
> all text fields, with one field that holds a date value (not sure if Excel
> stores that as text or some sort of timestamp?).
>
> I am well aware of all the tools you can use to convert .xls to something
> else (e.g., OpenOffice), but I would like to do it *natively* in PHP, or at
> least using a program that I can kick off from within PHP. That way I can
> upload an .xls file, and let my scripts worry about converting it to
> something easily inserted in MySQL.
>
> Any thoughts?
>
> Sincerely,
> -Josh[/color]
You'll have to 'roll your own' here. The various formats of Excel are
documented (Google showed the following):
http://chicago.sourceforge.net/devel/docs/excel http://sc.openoffice.org/excelfileformat.pdf
The top link has two links to php code to WRITE excel, but they don't
work very well. I found the following to be much better:
http://www.phpclasses.org/browse/package/767.html
None of the code out there does native reading of Excel. You'll have to
do it yourself.
Now I ask you:
How important is this to you and your project?
How much time do you have to spend on this?
What would be the "return on investment" of having the feature?
Get 3-6 months to code this up and build it into php?
--
DeeDee, don't press that button! DeeDee! NO! Dee...