|
Posted by Mladen Gogala on 11/19/66 11:45
On Mon, 17 Apr 2006 18:27:08 -0500, GregoryD wrote:
> I have a flat file that I'm trying to stick into a MySQL database. One
> record per line, multiple fields per record, and many of them are null
> fields which are just double quotes without a space between. It's probably
> nothing really major for people who have done this before, but I'm a bit
> stumped. The file is comma delimited. Every field is surrounded by double
> quotes. I've done quite a bit of searching, on the php site and elsewhere,
> but I can't seem to get it to strip the quotes out so I can explode the file
> line by line to grab the fields. Anyone have a quick solution?
>
> GregoryD
Sounds like something for preg_match with a patern like '/"(.*)",?/'. You
will have to repeat it until you exhaust the input string.
--
http://www.mgogala.com
Navigation:
[Reply to this message]
|