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 Quote 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? Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.