divadiva Posted January 27, 2009 Share Posted January 27, 2009 I exported the csv file to database successfully.Here is the command I have used: LOAD DATA LOCAL INFILE 'C:\\Book2 DATABASE.csv' INTO TABLE dataparsing.inventory FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' (fund,process,tool_id,manufacturer,model,description,in_production,serial_number,loc_ref,wafer_max,wafer_min,new_price,price_min,price,image1,image2,image3,image4,purchase_from,purchase_date) //with the new csv sheet I hav eto change price fro almost all the tool. But later on there were some changes and now have a new csv sheet.Now I dont know to modify .I cannot delete the tools as they have unique ids generated sequentially I can run update command but it would be a waste of time. Is there a way I can make a check so that if the inventiry id exist it should only populate the fields in database? Best Divya Link to comment https://forums.phpfreaks.com/topic/142673-help-with-exporting-csv-file-to-mysql/ Share on other sites More sharing options...
fenway Posted January 28, 2009 Share Posted January 28, 2009 Why not just use the REPLACE option? Link to comment https://forums.phpfreaks.com/topic/142673-help-with-exporting-csv-file-to-mysql/#findComment-748570 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.