skype

LiveZilla Live Help

Login



Blog
Comments
Home : Blog : CMS - Content Management Systems : Exporting, editing the mysql table and importing it back to database - With Excel

Exporting, editing the mysql table and importing it back to database - With Excel

E-mail
User Rating: / 0
PoorBest 
CMS - Content Management Systems
Monday, 31 October 2011 02:50

First go to mysql and select your table for example I am using uc_products table. that is used in Drupal Ubercart site. 

You just click on export and select 

Then you open the file in excel, and edit the data, remember, don't change how the rows are sorted, if you do that, put everything back like it was. 

I usually do that to change some prices, or mass change weight, dimensions for my products. 

ok so that is done. Now you export it as CVS comma delimited from Excel. 

my Excel is kind of weird. Exported file does not use ; to separate cells. It uses , for god sake. 

So first you need to do is to open your excel CVS file in notepad, and see how the file is structured

My first row looks like this

vid,nid,model,list_price,cost,sell_price,weight,weight_units,length,width,height,

As you can see there are no " " and no semicolons. 

The cells are separated by commas.

Then you open the table in your mysql, empty the table and click on import. 

Select import from 

CSV using LOAD DATA

and for me, this works

CSV drupal

As you can see I only filled the Fields terminated by with  ,  

That is it, this is the trick

Comments
Add New Search RSS
+/-
Write comment
Name:
Email:
 
Title:
 
Please input the anti-spam code that you can read in the image.