PHP, Excel, CSV and Problems!
| From: | Jeff Lacy | Date: | Sun, 22 Jul 2001 00:59:17 +0000 |
| Subject: | PHP, Excel, CSV and Problems! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-59036@lists.php.net to get a copy of this message | ||
Hello Everyone,
A client of mine is working with excel, and I need to move the data from
excel to something php can deal with a little better. Naturally, I figured
using .csv would be easiest, but I am running into several problems. I
can get around them, but I need a regular expression (and I am NOT good at
writing those).
I'm not quite sure how I should explain what the regular expression ought to
do, so I am giving an example of the data ought to look like in php (after
the regular expressions), and how it looks in the .csv.
NOTE: I am exploding the data, so all ,'s must be changed into COMMA's.
----------------------------------------------------------------------------
----------------
| php
| .csv |
----------------------------------------------------------------------------
----------------
heyaCOMMA there,hey is for horses "heya, there",hey is
for horses
"byeCOMMA bye",ciaoCOMMA ciao """bye,
bye""", "ciao, ciao"
"good morning,I'm Bob Villa """good
morning", I'm Bob Villa
sleep is good,IceCOMMA ThingyCOMMA sleep is good,"Ice, Thingy,"
If those four examples aren't enough, please let me know. I am NOT on the
php mailing list, so PLEASE send messages to me (jeffdl@mn.mediaone.net AND
to php-general@lists.php.net).
Thank you very much (in advance),
Jeff