File_CSV change request
| From: | Wolfram Kriesing | Date: | Mon, 14 Oct 2002 10:13:03 +0000 |
| Subject: | File_CSV change request | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-10045@lists.php.net to get a copy of this message | ||
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