Skip records in MYSQL text file import
Posted on 2012-09-09
I am looking for a way to skip "Bad" or "corrupt" records during the import of a data file. These are not records at the beginning of the file and can be in the middle of a several hundred thousand record file. I am using the following to import.
LOAD DATA INFILE 'C:\\DIRNAME\\FILENAME.TXT'
INTO TABLE TABLENAME
fields terminated BY '\t'
If I receive an error such as "Error Code: 1406. Data too long for column 'AreaCode' at row 155762.
So if I want to then run it again skipping row 155762 is there a way to do that?