I’ve created a script to read data exported as a Microsoft Excel CSV / tab-delimited text file , directly into a database using LOAD DATA INFILE.
It works great if the data from the original spreadsheet is properly written, but that’s of course not the case, and it’s been causing massive errors when the spreadsheets are poorly made.
I need a way to filter the data before importing it into the database. Is there a way to do that?
You just gave me an idea though. I’ll LOAD DATA into a temporary table, run the PHP filters on it there, then merge it with the main table afterward.
As I’m here, is there a simple MySQL query to add all data from one table to another? Or would I have to make a PHP loop to add the records one by one?