Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.1

Bug #4334 File_CSV::discoverFormat does not detect quotes in single column
Submitted: 2005-05-12 15:22 UTC
From: luke_richards_99 at yahoo dot co dot uk Assigned: dufuz
Status: Closed Package: File
PHP Version: 4.3.9 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2005-05-12 15:22 UTC] luke_richards_99 at yahoo dot co dot uk
Description: ------------ Using versions: PEAR ver 1.3.5 File ver 1.2.0 (cvs 1.29) File_CSV (cvs 1.19) When using a file with a single column format, the discoverFormat method doesn't detect the quotes. I believe the problem lies with line 473: preg_match("|^([$quotes]).*([$quotes])$sep should be preg_match("|^([$quotes]).*([$quotes])$sep{0,1} Reproduce code: --------------- Save a File <<< "Sample Data Line 1" "Sample Data Line 2" "Sample Data Line 3" "Sample Data Line 4" "Sample Data Line 5" >>> $config = File_CSV::discoverFormat("/path/to/file.txt"); Expected result: ---------------- Array ( [fields] => 1 [sep] => , [quote] => " ) Actual result: -------------- Array ( [fields] => 1 [sep] => , [quote] => null )

Comments

 [2005-05-12 20:49 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-05-21 06:26 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!