#26510 [Opn->Csd]: fgetcsv does not get all lines

From: Date: Sat, 06 Dec 2003 22:04:25 +0000
Subject: #26510 [Opn->Csd]: fgetcsv does not get all lines
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-51759@lists.php.net to get a copy of this message
ID: 26510 Updated by: iliaa@php.net Reported By: thomas303 at web dot de -Status: Open +Status: Closed Bug Type: Filesystem function related Operating System: Suse Linux 8.2 PHP Version: 4CVS-2003-12-4 Assigned To: iliaa New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2003-12-06 17:04:23] iliaa@php.net This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2003-12-04 20:15:06] iliaa@php.net The reason you get unequal amount of lines is because you use an un-escaped delimiter ("), which causes multiple lines to be parsed a single value. There is an unrelated bug in fgetcsv() in PHP 4.X, to which I am testing a patch now. ------------------------------------------------------------------------ [2003-12-03 16:09:25] thomas303 at web dot de Hi iliaa, one thing, I did was to do a count on the array of fgetcsv. In result it was alwas 18 values per line, so there is less data returned than data existing in the file, i think. best regards thomas ------------------------------------------------------------------------ [2003-12-03 15:37:44] iliaa@php.net fgetcvs() can support multi-line rows, which may explain why a file with X number of lines when read with fgetcvs() would return less lines (but equal amount of total data). If you cannot provide the original cvs file, could you provide an equivalent that can replicate the problem. Without a cvs file it's nearly impossible for us to resolve this problem. ------------------------------------------------------------------------ [2003-12-03 15:24:40] thomas303 at web dot de Hi, me again... in case I consider it correctly, fgetcsv is sometimes - reading and processing a line, and twice jumping to the next line - or ignoring one line and processing the next one. best regards thomas ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/26510 -- Edit this bug report at http://bugs.php.net/?id=26510&edit=1

« previous php.bugs (#51759) next »