You are here: Re: Stripping quotes out of a comma delimited file? « PHP Programming Language « IT news, forums, messages
Re: Stripping quotes out of a comma delimited file?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация