RE: [PHP3] CSV conversion. Inclusion in PHP?
| From: | Colin Viebrock | Date: | Wed, 28 Apr 1999 14:17:32 +0000 |
| Subject: | RE: [PHP3] CSV conversion. Inclusion in PHP? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-5282@lists.php.net to get a copy of this message | ||
> >One thing I did note is that you didn't mention if you took into account
> CRLF within a quoted field?
> >I was told this was part of the CSV spec?
>
> I've not seen any reference anywhere about CRLF being valid
> within a quoted
> field. My code is based on the assumption that one record = one line, so
> will fail to parse the data correctly on records that have an embedded end
> of line.
AFAIK, you can have embedded CRs and LFs in a quoted field. So you'll need
to modify the code a bit to allow those if you are inside quotes.
(Not having seen this code, I have no idea, but I imagine it's a fairly
trivial change. You must already be checking for commas inside quotes and
skipping them, so adding CR and LF to the list should be "easy".)
__________________________________________________________________
Colin Viebrock easyDNS Technologies
... be the master of your domain
http://www.easyDNS.com
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net