Jump to content

Help with exporting csv file to MYSQL ?


divadiva

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.