Miva Merchant 4 Module FAQs » Category Import (VIK_CATIMPT)


{docurl}

Importing Categories From a Flatfile

What is a flatfile and how do I use it?

The format for the flatfile is very simple:

categorycode|categoryname|parentcode|active

In this example, we have used the pipe character "|" a the delimiter (the character that separates the fields from each other). You can use tabs, commas, or anything else you like but we recommend using the pipe. For whatever delimiter you use though, you need to make sure that that particular character does not appear in your data itself.

For example, this would NOT work correctly:

category123|This is my |new| category name!|categoryxyz|1

The reason this would not work is that the pipe characters on each side of the word "new" will confuse the import, making it think that there are six fields to be imported, when there are only four. This problem is especially compounded if you have a tab delimited file as the tabs often cannot be seen--they look just like spaces. Thus, it's best to use the pipe character, which is a seldom used symbol.

In the above example, you can see that we used a "1" for the Active field. This is correct, or you can also use YES or TRUE.

Here is an example of a working flatfile:

category123|Category 123|Category ABC|1
category456|Category 456|Category ABC|1
category789|Category 789|Category ABC|1
categoryxyz|Category xyz||1

In this example, you'll notice that categoryxyz does not have any entry in the parent field. Leaving this field blank indicates that categoryxyz does not have a parent, it is a major category.


How to Make a Flatfile:

A flatfile is simply a text file, so pretty much any database or spreadsheet program can be used for creating the flatfile. You can use Excel for this, but it does have some quirks. Excel will generally put quote marks around some text so you may need to open any flatfiles exported from Excel to remove the quote marks.



Last update: 2003-08-12 21:30
Author: Support
Revision: 1.0

Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 5 out of 5 (1 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry