I'm going to make some assumptions here ... you will have to adapt the solution to work for you.
I'm assuming that the second field in the csv file is something that when compared file over file will indicate that the product was updated, something like a last updated timestamp.
$prodFile = fopen("current-products.csv", "r");
// build a list of all of the sku's in prodFile
$prods = array();
while ($rec = fgetcsv($prodFile)){
// I am assuming the second field is an updated timestamp
$prods[$rec[0]] = $rec[1];
}
fclose($prodFile);
$newProdFile = fopen("new-products.csv", "r");
$addFile = fopen("productsToAdd.csv", "w");
$updateFile = fopen("productsToUpdate.csv", "w");
while ($rec = fgetcsv($newProdFile)){
if (!array_key_exists($rec[0], $prods)){
fputcsv($addFile, $rec);
}
if (array_key_exists($rec[0], $prods) &&
$prods[$rec[0]] != $rec[1]){
fputcsv($updateFile, $rec);
}
}
fclose($newProductFile);
fclose($addFile);
fclose($updateFile);