note 38201 rejected from function.fgetcsv by vincent

From: Date: Thu, 11 Dec 2003 19:31:53 +0000
Subject: note 38201 rejected from function.fgetcsv by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-61828@lists.php.net to get a copy of this message
Note Submitter: peter@schoenster.com ---- Does anyone know how fgetcsv defines a CSV file? What format does it expect. It *seems* to be fine with the following: each field enclosed by double quotes a double quote in a field is escaped by a double qoute an end of record is CRLF So I have data coming from MSSQL and I use RegEx to quote a double quote with a double quote, I don't have to worry about new lines (or CRLF) in the data as I'm enclosing the field in double quotes (btw, I found the VBscript regex would die where a field is null so I don't bother to do the regex replace on it) This seems similar to the parser mysqlimport uses and the DBD_CSV from Perl's CPAN. I have found lots and lots of so called parsers that cannot handle embedded newlines or commas in fields. But then the csv file must have the enclosing quotes on all data fields. But back to my original question, is there any FIXED, KNOWN definition of what a CSV file is? As one of my cohorts said, certainly fgetcsv must have a model. I'd like to know what it is rather than guess.

« previous php.notes (#61828) next »