比较两个CSV文件并更新主CSV上的价格

比较两个CSV文件并更新主CSV上的价格

问题描述:

Magento CSV

SKU,Price
BFJ182H,£89.85
BFJ135Y,£163.10
EC32,£100.00
EC37,£104.00

Price Update Sheet

SKU,Price
BFJ182H,£109.47
BFJ135Y,£180.28
EC32,£150.69
EC37,£200.73

Basically what I want to do is run a query that searches for the SKU codes in the price update sheet and compares the price from the price update sheet against the price from the Magento CSV and if the price is different in the Magento CSV to the price in the price update sheet regardless of if it is lower or higher and update the price on the Magento CSV to the same as the price update sheet.

How can I go about doing this?

which I can then put back into the full CSV and re upload to their site to update the prices.

Magento CSV strong> p>

  SKU  ,价格
BFJ182H,£89.85 
BFJ135Y,£163.10 
EC32,£100.00 
EC37,£104.00 
  code>  pre> 
 
 

价格更新表 strong>

SKU,Price
BFJ182H,£109.47
BFJ135Y,£180.28
EC32,£150.69
EC37,£200.73

基本上我想要做的是运行一个查询,在价格更新表中搜索SKU代码,并将价格更新表中的价格与Magento CSV中的价格进行比较,如果Magento CSV中的价格不同 价格更新表中的价格,无论是更低还是更高,并将Magento CSV上的价格更新为价格更新表。 p>

我该怎么做 这个? p>

我可以将其放回完整的CSV并重新上传到他们的网站以更新价格。 p> div>

Use magmi instead. http://sourceforge.net/projects/magmi/

It takes a little while to learn -- but when you do get around learning the import processes using this tool, you'll never look back.

Read the docs! http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Main_Page

For magmi, your price update sheet alone is already almost sufficient to do the update. (you don't need the original CSV really, assuming you already have values from Magento CSV as current prices on your Magento store). You just need the 'store' column after sku e.g.:

sku,store,price
BFJ182H,admin,109.47
BFJ135Y,admin,180.28
EC32,admin,150.69
EC37,admin,200.73

The above assumes that your default store currency is GBP (£) and the store value set at 'admin' tells magmi to update default values. replace with appropriate store code(s). More at the documentation for this specific feature: http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Magmi_Behaviour_-_store_column

Good luck!