RE: [PHP] regex question
| From: | Boget, Chris | Date: | Mon, 17 Jul 2000 18:22:05 +0000 |
| Subject: | RE: [PHP] regex question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-6944@lists.php.net to get a copy of this message | ||
> Ok, I give up - help!
> I have to read data in exported from an Outlook Express
> address book. I have used file() on the address book file to get
> in into an \array. The data is CSV, and fields with commas are
> quoted. I am trying to use a regex to simply make a dynamic
> query string like this for each row.
> insert into $db_name('a','b',"hey, this is a quoted field
> with commas",.....)
> I am trying to use the PCRE to do this. How would I do this?
There is a feature of mySQL (if that is what you are using; I'm
sure that most other flavors of SQL would have it but am unsure)
that you should look into and could make your life infinitely
easier:
LOAD DATA INFILE
it is a godsend for situation like this.
Chris