Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

import CSV with LOAD DATA INFILE


Guest

Recommended Posts

Hey,

 

I'm not a newbie but I don't have that lot experience in Mysql and PHP. I've setup a new oscommerce shop.

Everything works fine.

 

I want to be able to import a csv file from my distributor. I that way I able to keep my shop uptodate without any manual intervention.

 

I've tried the import csv plugin but that didn't work for me. I think it is because the product_id,price,weight,...are in a different sequence.

After searching the net I found the mysql LOAD DATA INFILE. This should do it for me. But again...it is a bit to complex.(warnings) Can anyone help me with the right syntax?

I'll put some lines of the CSV and the command I did:

 

PRLOK929081;OKI Printer Laser Mono B4100 NON;85.48;0; ;; ;; ;; ;; ;;http://www.dddistribution.be/prod_images/PRLOK929081.jpg;http://www.dddistribution.be/prod_images/PRLOK929081-big.jpg;

PRLOK931025;Oki B6200/NON 128MB 24ppm 1200x1200dpi A4;451.95;0;RECTD0.04;0.04000; ;; ;; ;; ;;http://www.dddistribution.be/prod_images/PRLOK931025.jpg;http://www.dddistribution.be/prod_images/PRLOK931025-big.jpg;

PRLOK931026;Oki B6200N/NON 128MB 24ppm 1200x1200dpi A4;573.47;0;RECTD0.04;0.04000; ;; ;; ;; ;;http://www.dddistribution.be/prod_images/PRLOK931026.jpg;http://www.dddistribution.be/prod_images/PRLOK931026-big.jpg;

PRLOK931027;Oki B6200DN/NON 128MB 24ppm 1200x1200dpi A4;681.88;0;RECTD0;0.00000; ;; ;; ;; ;;http://www.dddistribution.be/prod_images/PRLOK931027.jpg;http://www.dddistribution.be/prod_images/PRLOK931027-big.jpg;

 

 

the command I used was:

 

mysql> LOAD DATA INFILE '/var/www/webshop/catalog/admin/csv_import/csv/stock.csv' replace INTO TABLE [products] FIELDS TERMINATED BY ';' LINES TERMINATED BY '\n' (manufacturers_id,products_model,products_price,products_quantity,products_image

);

 

 

Does anyone has some experience with importing a csv file?

Thanks for the help.

Link to comment
Share on other sites

Most people use the EasyPopulate contribution.

 

Easy to install and after reading the documentation easy to use.

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Most people use the EasyPopulate contribution.

 

Easy to install and after reading the documentation easy to use.

 

Great, I'm going to check this out, thanks!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...