Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

File Editing with Excel Rate Topic   - - - - -

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3879 posts

Posted 17 July 2009 - 12:08 PM #1

I am not sure why but I seem to be having trouble importing files that I have edited in Excel. I did not have any problems with 1.x version but seem to in 2.x. Is anyone else editing in Excel and importing the file fine? If so, what are your settings?

I do know that Excel changes the original as you can see below in the comparison but this is beginning to drive me crazy. The difference is the quotes.

Original export opened in notepad:
Product code,Supplier
"WATTRX5210","WTD"
"WATTRX5213","WTD"
"WATTRX6013R","WTD"
"WATTRX6013RBK","WTD"
"WATTRX6013RBU","WTD"
"WATWB4202","WTD"
"WATWI1210","WTD"
"WATWI1511","WTD"
"WATWI1511BK","WTD"
"WATWI1511BU","WTD"
"KEN36045","WTD"

Excel edited file opened in notepad:
Product code,Supplier
WATTRX5210,WTD
WATTRX5213,WTD
WATTRX6013R,WTD
WATTRX6013RBK,WTD
WATTRX6013RBU,WTD
WATWB4202,WTD
WATWI1210,WTD
WATWI1511,WTD
WATWI1511BK,WTD
WATWI1511BU,WTD
KEN36045,WTD


 
  • baniels
  • Member
  • Members
  • Join Date: 23-Jan 09
  • 95 posts

Posted 17 July 2009 - 05:55 PM #2

I have done massive amounts of imports and exports using CSV. I have never had this problem.

When are the quotes appearing?
www.chimneyfamily.com
CS-Cart 2.0.6
Hosted by CyberLNC :-D

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3879 posts

Posted 17 July 2009 - 07:17 PM #3

The quotes are in the original export.

Are you editing with Excel and then importing with no problems?

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3879 posts

Posted 18 July 2009 - 06:24 PM #4

Well it's not the quotes that is causing the problem because that is how it is exporting in 1.3.5. I don't know what the hell is going on.

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3879 posts

Posted 18 July 2009 - 11:00 PM #5

This is actually a bug. I installed a fresh copy of 2.0.5 and had no problems importing an Excel edited file. As soon as I updated from 2.0.5 to 2.0.6 then I could no longer import without errors.

 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 18 July 2009 - 11:44 PM #6

I find it much easier to import the products using the Import tab in the PHPMyAdmin tool that most servers have installed. I export from excel into csv format and import directly in the database through PHPMyAdmin. The trick is to create the columns in Excel that match the order of the columns in the database. Of course multiple tables will need to be imported (i.e. options, price, description, etc), but I have an Excel file that matches each cs-cart product table.

Much easier than using the Cs-Cart import.

 

Posted 19 July 2009 - 01:46 AM #7

Confirmed in red

This is actually a bug. I installed a fresh copy of 2.0.5 and had no problems importing an Excel edited file. As soon as I updated from 2.0.5 to 2.0.6 then I could no longer import without errors.


I've moved on from CS-Cart to WooC******** - If you need anything I can be of little help.

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3879 posts

Posted 19 July 2009 - 05:41 AM #8

This problem is a result of the changes made to /core/fn_fs.php. I could see some of the changes but was not about to analyze all of the changes so I just uploaded the file from 2.0.5.

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3879 posts

Posted 19 July 2009 - 10:19 AM #9

Edit "core/fn.fs.php" and replace


list ($field) = explode($d, trim($st, "\r\n"), 2);

with

list ($field) = explode($d, $st, 2);


 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3879 posts

Posted 20 July 2009 - 06:09 PM #10

Official fix.

The official solution (core/fn.fs.php)

replace

list ($field) = explode($d, trim($st, "\r\n"), 2);
			$st = substr($st, strlen($field) + strlen($d));

with


list ($field) = explode($d, $st, 2);
			$st = substr($st, strlen($field) + strlen($d));
			$field = trim($field);
			if (empty($field)) {
				continue;
			}



 
  • jnproducts
  • Junior Member
  • Banned
  • Join Date: 26-Mar 08
  • 25 posts

Posted 21 July 2009 - 12:09 AM #11

Tool Outfitters,

Hi, I tried applying the code you supplied because I'm having errors uploading on v2.0.6. The new code fixes my upload issue for products but it's causing my other upload menus for Goggle Base, Images and Qty Discounts to disappear? With this code fix are you seeing the same thing happen?

Thanks,

Jason

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3879 posts

Posted 21 July 2009 - 12:23 AM #12

No problems here. Try clearing your cache.

 
  • jnproducts
  • Junior Member
  • Banned
  • Join Date: 26-Mar 08
  • 25 posts

Posted 21 July 2009 - 12:42 PM #13

Working now. Thanks!

 
  • Eddy
  • Member
  • Members
  • Join Date: 08-Nov 07
  • 37 posts

Posted 25 July 2009 - 07:38 PM #14

Edit "core/fn.fs.php" and replace


list ($field) = explode($d, trim($st, "\r\n"), 2);

with

list ($field) = explode($d, $st, 2);


THanks so many