Re: [new] File_CSV class avaible
| From: | Tomas V.V.Cox | Date: | Mon, 15 Apr 2002 23:48:35 +0000 |
| Subject: | Re: [new] File_CSV class avaible | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-5537@lists.php.net to get a copy of this message | ||
Brent Cook wrote:
>
> > Hi,
> >
> > I just want to announce that the new class File_CSV is avaible. As the
> > name suggests this class is for handling CSV files. The CSV (Comma
> > Separated Values) is a common format for exporting/importing data in a
> > simple way (well sometimes not so simple). Those files looks like:
>
> DAMN! You beat me to it. I have a CSV class that reimplements all of the
> PHP dbm functions too. I can't wait to see what your approach was!
I haven't implemented any helper method yet, if you want I could add
those you have.
> Format discovery! I'm so excited! Multiline data is also tres cool!
The format discovery was done because I got tired to comment/uncomment
the different configurations for each file I was testing (yes, call me
lazy). And hey, it seems to be pretty intelligent :).
FYI, the conf looks like:
$conf = array(
'sep' => "\t", // the fields delimitier
'fields' => 7, // the number of fields
'header' => true, // if has or not a header line
'quote' => '"' // the quote char or false
);
> > PS.- Someone liking to develop a CSV driver for PEAR DB? ;-)
>
> I have a semi-relational database that uses CSV files (it still needs join
> and a more featureful select) The reason I can call it semi-relational is
> because I can simulate a join by creating two tables and use
> array_intersect() on two select results. It doesn't support the ACID
> properties because table-locking is broken, but hey!
>
> You can browse last-month's PHPDoc for the database class here - it's
> called fdb:
> http://ozma.union.utexas.edu/~txunion/test/doc/test1/
>
> I use it for apps like this events calendar:
> http://www.utexas.edu/student/txunion/calendar/
> and a catalog:
> http://www.utexas.edu/student/txunion/ae/iclass/courses/
>
> It seems to handle around 800 records pretty well, though I'm working on a
> system that works well with a few thousand records called rdb (a real
> relational database manager!) It even supports table locking (though row
> locking is way too much trouble without shared memory). Slap in a SQL
> parser, and viola!
>
Sounds pretty cool. Want to put your hands on it? DBI can't beat us on
that ;-) I also thought in a limited SQL parser while coding the PEAR DB
dbase driver.
Tomas V.V.Cox