https://www.kaggle.com/openfoodfacts/world-food-facts has a retarded sparse matrix structure with the nutrients as columns.
I need this normalized properly. The columns should probably be something like ProductID, NutrientID, value, units.
It would be ideal to have a general purpose scrpt, preferably PHP, but maybe SQL, to do this. If PHP it has to make the database connection, and take the table name, as around 5 configuration variables, along with a way to assign the column names, values, units to database fields in the new table. I can do a lot of this in PHPMyAdmin, I don't need a lot of magic.
In both cases, the column list can pretty easily be gleaned from Information_Schema.
Copyright © 2019 | Truelancer.com