RE: [PEAR-DEV] File_CSV change request

From: Date: Tue, 15 Oct 2002 18:37:26 +0000
Subject: RE: [PEAR-DEV] File_CSV change request
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-10069@lists.php.net to get a copy of this message
> -----Original Message----- > From: Arnaud Limbourg [mailto:arnaud.limbourg@club-internet.fr] > Sent: Tuesday, October 15, 2002 7:35 PM > To: Wolfram Kriesing > Cc: pear-dev@lists.php.net; cox@idecnet.com > Subject: Re: [PEAR-DEV] File_CSV change request > > Tomas, the maintainer, is not available for the moment. I'm afraid this > will have to wait until he shows up. > shouldn't be too long until he is back. Regards, Lukas > > 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 > > > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.pear.dev (#10069) next »