kirk112 Posted April 28, 2008 Share Posted April 28, 2008 Hi I have the following query LOAD DATA INFILE 'd:/websites/dev/cm/data/cm_products20080428.php' INTO TABLE cm_products FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\r\n' ( url, category_1, category_2, category_3, manufacturer, product_code, product_name, product_description, small_image, price) which imports the data from a file but I want to ignore the first line ('\r\n' IGNORE 1 LINES ...) but as soon as I add this to the query no information is imported. I have add a sample of the imformation to be imported below "url","category 1","category 2","category 3","manufacturer","product code","product name","product description","small image","price" "www.example.com","Toner Cartridges","Lexmark","Lexmark E320","Lexmark","08A0475","Lexmark","Description","image","75.38" "www.example.com","Toner Cartridges","Lexmark","Lexmark E320","Lexmark","08A0475","Lexmark","Description","image","75.38" "www.example.com","Toner Cartridges","Lexmark","Lexmark E320","Lexmark","08A0475","Lexmark","Description","image","75.38" Any ideas why it's not importing the data the I ask it to ignore the first line Thanks for your help Quote Link to comment Share on other sites More sharing options...
fenway Posted April 28, 2008 Share Posted April 28, 2008 Because the first line isn't data. Quote Link to comment Share on other sites More sharing options...
kirk112 Posted April 29, 2008 Author Share Posted April 29, 2008 What is the first line then? a header? if so how can I ignore this? Thanks fenway Quote Link to comment Share on other sites More sharing options...
fenway Posted April 29, 2008 Share Posted April 29, 2008 What is the first line then? a header? if so how can I ignore this? Yes, it's just the column mapping. Are you sure you have CRLF and not just LF? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.