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 Link to comment https://forums.phpfreaks.com/topic/103262-load-data/ Share on other sites More sharing options...
fenway Posted April 28, 2008 Share Posted April 28, 2008 Because the first line isn't data. Link to comment https://forums.phpfreaks.com/topic/103262-load-data/#findComment-528974 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 Link to comment https://forums.phpfreaks.com/topic/103262-load-data/#findComment-529361 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? Link to comment https://forums.phpfreaks.com/topic/103262-load-data/#findComment-529491 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.