Forums / All Other Contributions/Addons / Changing field enclosure symbol for Easy Populate

Changing field enclosure symbol for Easy Populate

Views: 623

Results 1 to 3 of 3
20 Jun 2014, 12:04 AM
#1
jax2 avatar

jax2

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Changing field enclosure symbol for Easy Populate

Hi guys,

I have a bit of an issue here.

I have been working for 2 days getting a .csv ready to upload into my zen cart with over 10,000 products ...

My issue is this:

Because so many of the product descriptions had " (quotes) and ' (apostrophes) in them, I changed the field enclosure symbol from " (quotes) to an @ symbol.

This works perfectly fine if I upload via MySql to a working table I have, but when I attempt to upload to the shop, it's completely screwed up, as Easy Populate only seems to recognize " (quotes) as the field enclosure symbol.

When I uploaded my CSV (After, thank god, having backed up my entire database), it created a mess, hundreds of new categories added, named after fields like price, weight ...etc, all because of the quotes.

Could anyone tell me how I could reconfigure Easy Populate to accept csv's with a field enclosure being an @ symbol instead of quotes?

Thank you in advance!

20 Jun 2014, 8:02 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Changing field enclosure symbol for Easy Populate

jax2:

Hi guys,

I have a bit of an issue here.

I have been working for 2 days getting a .csv ready to upload into my zen cart with over 10,000 products ...

My issue is this:

Because so many of the product descriptions had " (quotes) and ' (apostrophes) in them, I changed the field enclosure symbol from " (quotes) to an @ symbol.

This works perfectly fine if I upload via MySql to a working table I have, but when I attempt to upload to the shop, it's completely screwed up, as Easy Populate only seems to recognize " (quotes) as the field enclosure symbol.

When I uploaded my CSV (After, thank god, having backed up my entire database), it created a mess, hundreds of new categories added, named after fields like price, weight ...etc, all because of the quotes.

Could anyone tell me how I could reconfigure Easy Populate to accept csv's with a field enclosure being an @ symbol instead of quotes?

Thank you in advance!

Okay, several items of concern related to this, why weren't/ aren't the single and double quotes escaped either by you or by the editor being used to create the CSV file? In other words a ' replaced with ' and a " replaced with " before saving the file such that each field begins and ends with '? What editor is being used? Have you tried Open Office which is pretty good with working with files that will be CSV?
For some reason I seem to recall that the read in process isn't exactly picking and choosing what character to use as the start and finish to a field, but rather a "natural" divider like the beginning and end of a string. Otherwise it will basically need to do what. Could have just as easily been done in the file when it was saved or edited. That said, I'd have to look at the code in that specific area to see what would need to be done to have EP do what is already programmed into other freely available utilities.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

20 Jun 2014, 10:13 AM
#3
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,805
Plugin Contributions:
22

Re: Changing field enclosure symbol for Easy Populate

I would prefer using pipe ( | ) as field separator. You can change the settings for EasyPopulate in:
YOUR_ADMIN/easypopulate.php
around line 40 find:

$csv_deliminator = ","; // "\t" for tab

and replace with:

$csv_deliminator = "|"; // "\t" for tab

Now make sure you save your files with the pipe character as delimiter. As suggested by mc12345678, you should try using OpenOffice Calc - it's a bit better when it comes to handling CSV files and allows you to define delimiters on each save (edit filter settings).

My site - Pro ZC Help
My portfolio | My plugins