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 9 8891
Joshua Beall wrote: 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
good idea! write a php function set for this! we're all looking forward
to use it... ;)
ar.
"Allan Rydberg" <al****@southtech.net> wrote in message
news:cc**********@newshispeed.ch... Joshua Beall wrote: good idea! write a php function set for this! we're all looking forward to use it... ;)
There are actually some commercial solutions for this, but I was hoping for
something Open Source.
There is also a PEAR package that lets you write XLS files, but none (afaik)
that let you read. Hmm.
Any pointers?
"Joshua Beall" <jb****@donotspam.remove.me.heraldic.us> wrote in message
news:yX*****************@nwrddc01.gnilink.net... "Allan Rydberg" <al****@southtech.net> wrote in message news:cc**********@newshispeed.ch... Joshua Beall wrote: good idea! write a php function set for this! we're all looking forward to use it... ;) There are actually some commercial solutions for this, but I was hoping
for something Open Source.
There is also a PEAR package that lets you write XLS files, but none
(afaik) that let you read. Hmm.
Any pointers?
It is possible on Windos platforms by using COM objects, but I bet you want
NIX compatiblity don't you?
> It is possible on Windos platforms by using COM objects, but I bet you
want NIX compatiblity don't you?
You're a mind reader ;-)
In article <VA******************@nwrddc03.gnilink.net>,
"Joshua Beall" <jb****@donotspam.remove.me.heraldic.us> wrote: 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
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...
Joshua Beall wrote: 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*val ue*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. http://pear.php.net/package-info.php...t_Excel_Writer
--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Chris Hope wrote: Joshua Beall wrote: 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*val ue*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. http://pear.php.net/package-info.php...t_Excel_Writer
I'm still half asleep. There I was misreading what you wrote and thought you
were trying to write an xls not read one...
--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
"Chris Hope" <bl*******@electrictoolbox.com> wrote in message
news:10**************@216.128.74.129... http://pear.php.net/package-info.php...t_Excel_Writer
I'm still half asleep. There I was misreading what you wrote and thought you
were trying to write an xls not read one...
I am actually using that package right now to dump the contents, after
processing, back to an xls that the user can download.
I think, however (As Michael Vilain pointed out in another post), that if it
comes down to either writing my own .xls reader, or simply insisting that
users export to .csv before uploading, the latter is probably the better
solution, due to the narrow scope of the project I am working on. There
will not be more than a handful of people using this tool, and they too
would probably rather it be done now, and they have to export to .csv once
per week to upload to the website. Perhaps more to the point, they would
rather do that than *pay* me to roll my own .xls reader.
So, I guess that is the end of that. Although, if someone knows where I
should be looking, do let me know!
-jb
On Thu, 01 Jul 2004 16:27:10 +0000, Joshua Beall wrote: "Allan Rydberg" <al****@southtech.net> wrote in message news:cc**********@newshispeed.ch... Joshua Beall wrote: good idea! write a php function set for this! we're all looking forward to use it... ;)
There are actually some commercial solutions for this, but I was hoping for something Open Source.
There is also a PEAR package that lets you write XLS files, but none (afaik) that let you read. Hmm.
Any pointers?
xls2csv
Haven't used it, but it might do what you want by calling it within PHP
with system() or the like. http://www.45.free.net/~vitus/ice/catdoc/
later...
--
Jeffrey Silverman je*****@pantsjhu.edu
Drop "pants" to reply by email This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Hans-Joachim Widmaier |
last post by:
Hi all.
Handling files is an extremely frequent task in programming, so most
programming languages have an abstraction of the basic files offered by
the underlying operating system. This is...
|
by: Kamal Dhingra |
last post by:
Hi Guys,
I am developing an asp.net application .In error handling , I have 2 web.congif files ,one is in Web(which is the virtual directory) ,other i have created in a folder in Web/Admin. The...
|
by: dudufigueiredo |
last post by:
I have one folder containing mp3 files, the folder is:
C:\My Shared Folder\Rubber Soul
And the files are:
01 drive my car.mp3
02 norwegian wood.mp3
03 you won't see me.mp3
04 nowhere man.mp3...
|
by: Kamal Dhingra |
last post by:
Hi Guys,
I am developing an asp.net application .In error handling , I have 2 web.congif files ,one is in Web(which is the virtual directory) ,other i have created in a folder in Web/Admin. The...
|
by: ss |
last post by:
Hi
Can anyone show a sample code where the error handling is done with the
logging the errors.
What are the best methods of logging the errors in .net
perticularly in WEB Application
...
|
by: sona |
last post by:
hi all
i m using the function SetFilePointer to move the file pointer to a
64-bit offset.
i m using it as follows n writting my data but everytime it jumps to
the same location for ne offset...
|
by: Brianm27 |
last post by:
Ok i am having the worst time ever trying to figure out how to do this project! Please can anyone help lead me into the rite direction!
This is what I have to do:
1. Create a file with...
|
by: David C |
last post by:
I have an asp.net VB application that gets a filename and tries to display
it on a web page. It seems to be truncating the name when the name contains
"&" in it. Below is what I am using to grab...
|
by: Mohit |
last post by:
Hi All,
1. I have a context menu with some items in it. I have not assigned
any key board shortcuts to any menu item. Now when the context menu is
open and some key (say 'a') is pressed and if...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: lllomh |
last post by:
How does React native implement an English player?
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| |