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] dufuz
I'll try to look into this asap.
 [2005-05-21 06:26 UTC] dufuz
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.