Archive: csv

 

Posts Tagged ‘csv’


So now that everyone uses Google Shopping, Google are making life difficult for the merchants and they all have to jump through hoops. The current push from Google is enforcing some things that are very difficult for small companies to conform with :- * EAN Numbers – This is the BIG one, Google are making [...]



 

If you want to offer a csv feed and want the results to be on demand and like the idea of avoiding messing about righting to files on the server etc, you might like this little manuever. You will notice I'm using a non standard db_query function, just assume that this does all the sensible [...]



 

Linux has a great little utility called split, which can take a file and split it into chunks of whatever size you want, eg 100 line chunks. However, for CSV files etc, each chunk generally needs to have the header row in there. Unfortunately the split command doesn't have an option for that. However with [...]



 

This little PHP function will allow you to import a csv or tab etc delimited text file into a database table. Handy if you need it PLAIN TEXT PHP: function build_table_from_file($tablename, $filepath, $delim="\t") {     db_query("DROP TABLE IF EXISTS $tablename");     $fp=fopen($filepath, 'r');     $headers=false;     while($r=(($delim=='csv')?fgetcsv($fp):fgets($fp))) {       [...]