Page 1 of 1

Export/import problem with comma in price

Posted: Thu Dec 30, 2010 10:45 pm
by sickboy
Hi,

I'm using Open Cart 1.4.9.1 in combination with the import/export extension.
It works fine except for one thing.

When i import the excel file i get the folowing error:

Code: Select all

Error: Column count doesn't match value count at row 1
Error No: 1136
INSERT INTO `opencart_product` (`product_id`,`quantity`,`sku`,`location`,`stock_status_id`,`model`,`manufacturer_id`,`image`,`shipping`,`price`,`date_added`,`date_modified`,`date_available`,`weight`,`weight_class_id`,`status`,`tax_class_id`,`viewed`,`length`,`width`,`height`,`length_class_id`,`sort_order`,`subtract`,`minimum`,`cost`) VALUES (1,1,'0','0',5,' ',19,'data/Abus_1958g.jpg',1,83,95,'2010-12-30 13:57:21',NOW(),'2010-12-30 13:57:21',0,1,1,0,0,0,0,0,'1','0','1','1',0);
The problem is that the import tool "thinks" that the comma seperator in the price field is al column seperator.
When I place the price between quotes like this '83,95' the import works, but the number turn into 83,00.
This happens with al the prices.
When i copy the data in the excel sheet, the column has the correct format: ######0,00.
I tried it as character/text and as number but that doesn't mather.
When i use the export function en change the values afther the comma, the import works fine.
I think it has something to do with the copy of the data from one sheet to the other.
Could someone help me with this problem?

Re: Export/import problem with comma in price

Posted: Sun Jan 02, 2011 6:14 am
by kuipje
Don't use the , for ammounts, use the dot instead.

Re: Export/import problem with comma in price

Posted: Mon Jan 03, 2011 1:16 am
by sickboy
Thanks, that works.

I thought that i tried that allready.
It is strange that when you export the data, the price is with a comma instead of a dot
and when you import that same data it works fine...

Re: Export/import problem with comma in price

Posted: Mon Jan 03, 2011 11:01 pm
by peteVA
sickboy wrote:Thanks, that works.

I thought that i tried that allready.
It is strange that when you export the data, the price is with a comma instead of a dot
and when you import that same data it works fine...
CSV - Comma Separated Values - Every comma in a csv file is taken to be an indication of a new column.

There are other ways around it, but if you can simply use a period in place of a comma, that's quick and easy.