Crossposting a translation of my original answer at Stack Overflow in Portuguese:
It's always possible to load all data to a temporary table and later copy only desired rows to the destination table.
Assuming a table called contacts
:
CREATE TEMPORARY TABLE contacts_temp LIKE contacts;
LOAD DATA LOCAL INFILE 'my_file' INTO TABLE contacts_temp;
INSERT INTO contacts (phones, validated, dt_imp)
SELECT phone, validated, dt_imp
FROM contacts_temp
WHERE validated = 'YES';
-- drop statement is only useful if you are planning to keep the
-- current session open
DROP TEMPORARY TABLE contacts_temp;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…