Jump to content

CSV files


Jimbo_17

Recommended Posts

I've done this before... fopen() fgets(), then explode() by comma.

No sorting, no joining, no relations, no indexing, and rudimentary searching. Depending on the size of the file, it might even be snail slow.

Better idea: Write a converter to put your CSV into a mysql database. I have several of these running through cron. They download the CSV file via FTP, parse it, and dump it into a mysql database -- every day. MySQL loves doing advanced searches and sorts lightning fast.
Link to comment
https://forums.phpfreaks.com/topic/12695-csv-files/#findComment-48700
Share on other sites

Instead of
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]fopen() fgets(), then explode() by comma.[/quote]
you really should look at the [a href=\"http://www.php.net/fgetcsv\" target=\"_blank\"]fgetcsv()[/a] function, since it knows how to handle commas inside a quoted string.

Ken
Link to comment
https://forums.phpfreaks.com/topic/12695-csv-files/#findComment-48709
Share on other sites

Might look at these...

[a href=\"http://www.c-worker.ch/txtdbapi/index_eng.php\" target=\"_blank\"]http://www.c-worker.ch/txtdbapi/index_eng.php[/a]

[a href=\"http://ffdb-php.cvs.sourceforge.net/ffdb-php/README?revision=1.6&view=markup\" target=\"_blank\"]http://ffdb-php.cvs.sourceforge.net/ffdb-p...1.6&view=markup[/a]



Lite...
Link to comment
https://forums.phpfreaks.com/topic/12695-csv-files/#findComment-48751
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.