Re: File_CSV change request
| From: | Arnaud Limbourg | Date: | Tue, 15 Oct 2002 17:34:40 +0000 |
| Subject: | Re: File_CSV change request | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-10063@lists.php.net to get a copy of this message | ||
Tomas, the maintainer, is not available for the moment. I'm afraid this will have to wait until
he shows up.
Arnaud.
> i am using the File_CSV to import CSV data, unfortunately the source i
> am getting the files from is not providing perfectly styled files, so
> there are lines with 3 and other with 4 seperators on it.
> i.e.
> data;data;data;data
> data;data;data
> data;data;data;data
>
> since i only need the first 2 rows i would be glad if teh read method
> would work this way, that when i say in the
> $conf['fields']=2
> that the following check is not even done, so that my file will work
> fine, since it would if this check was not there.
>
> if (count($fields) != $conf['fields']) {
> File_CSV::raiseError(
> "Read wrong fields number count: '". count($fields) .
> "' expected ".$conf['fields']);
> return true;
>
>
> i'd suggest:
> -------------
> 1. if less fields than given in conf are given it might be critical
> more fields dont bother, if conf says the user only wants less
> if (count($fields) < $conf['fields']) {
>
> OR
>
> 2. add another conf parameter which tells to check the field size
> if ( $conf['checkNumFields'] &&
> count($fields) != $conf['fields']) {
>
>
>
> --
> Wolfram
>
> .... translating template engine ....
> http://sf.net/projects/simpletpl
>
> .... authentication system ....
> http://sf.net/projects/auth
>
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>