PHP, Excel, .CSV's, and Regular Expressions Help Needed!
| From: | Jeff Lacy | Date: | Mon, 23 Jul 2001 19:55:44 +0000 |
| Subject: | PHP, Excel, .CSV's, and Regular Expressions Help Needed! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-59255@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 | .cvs
|
+---------------------------------------+----------------------------+
piCOMMA 3.14,hey is for horses "pi, 3.14",hey is for horses
"byeCOMMA bye",ciaoCOMMA ciao """bye, bye""", "ciao,
ciao"
"good morning,I'm Bob """good morning",
I'm Bob
sleep is good,IceCOMMACOMMA sleep is good,"Ice,,"
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