csv -> xml conversion script

macgeek's picture
Offline
Bug Finder
Joined: 08/15/2007
Juice: 36
csv -> xml conversion script

Ok, well that leaves me kinda stuck! I can generate similar xml but can't import it. So I offer up my csv->xml converter script, which gets me to the same point of the uc_importer generated xml after a good product export.

First, export your excel document into csv, with the first row being column headings. Then fire up the csv2xml.php script in your web browser, and make sure you've uploaded your csv file into the same path.

I've also attached the example file I've used as my csv input (just 2 rows - a header row and a product data row) - just remove the .html at the end (comments don't allow a .csv file as an upload option).

It's rough and ugly, but does the job. Let me know if it's useful. Ideally it would be integrated into the uc_importer module. And optimised! Right now it reads the .csv file about 3 times during the course of the export...

AttachmentSize
csv2xml.php_.txt 12.52 KB
product-single.csv_.html 229 bytes
Import/Export By: futurist (106 replies) Wed, 08/08/2007 - 10:06