File format for Data Load input files

To run the Data Load utility, an input file is required. The input file must be a CSV file. Your input file must follow a particular format for the Data Load to be able to load your file.

Feature Pack 6 or laterYou can also load this data in XML format. If you choose to create and use an XML formatted file, ensure that your file uses the CSV column names as the XML element names.

When you are creating your CSV or XML file, ensure that you follow the tips and recommendations for CSV and XML files that are included in Data Load utility best practices.

If you are loading data into tables and columns that are provided by default in WebSphere Commerce, use the existing Data Load samples or examples to help create your load file. Select a sample or example that closely matches the data you are loading. Replace the sample data, with your own data and run the Data Load utility. The business object builders and mediators that are provided by default map your load file contents into the correct database tables. For more information about the default provided samples and examples, see:

If you must load UserData into existing WebSphere Commerce database tables that are extended, add your UserData into a default provided sample or example CSV file. To load a file with UserData, you can use the provided TableObjectBuilder and TableObjectMediator to load the file with UserData into the correct table and columns. If you customize Management Center or generate SDO extensions to use this UserData, you must first map the custom data to a logic noun UserData field. Then, you can load your input file with UserData.

If you are loading custom data into a custom table, you can use the TableObjectBuilder and TableObjectMediator to load your file when you run the Data Load utility. You can also create your own custom column handlers or custom mediators.

CSV file format

In your CSV file, you must specify the business object that you are loading information about and include the object data that you are loading. To specify the business object, include a keyword that associates your input file with a mediator that is used to load your data. For a list of the keywords that are provided by default, see Keywords.

The following image displays an example of a CSV file that you can use to load catalog data; this example uploads a sales catalog:
Sample catalog CSV file snapshot
In the CSV file:
  • The first row contains the keyword that corresponds to the business object you are loading. This keyword is case-sensitive. For example, Catalog for catalogs, or CatalogEntry for catalog entries.
  • The second row contains the column headings for the object you are loading. These column headings are case-sensitive and must match the name that the column maps to within the loader file for the business object type. For example, the object Identifier or ShortDescription.
  • In the remaining rows of the file, include data values that correspond to the column headings you included in the previous step.
If you are loading data with a specific component-based mediator, your CSV file must contain only one type of business object. In other words, do not combine two different CSV files into one larger CSV file. Your CSV files, however can contain multiple objects for a particular business object type. For example, you can load many catalog entries in a single CSV file that uses the catalog entry mediator. If you specify that the Data Load utility is to use the table object based mediator, you can combine multiple types of business objects in a single file. For more information about the available component and table object based mediators, see

For more information about creating files in CSV format for the Data Load utility, see the following topic: Creating catalog data in CSV format.

XML file format

To load data in an XML formatted file, your file must be similar to the structure and contents included in the supported CSV file format. You must specify a keyword to associate the business object you are loading with a mediator and separate individual objects of a business object type within different elements. For a list of the keywords that are provided by default, see Keywords.

The following code is an example of an XML file that you can use to upload catalog data; this example uploads two sales catalogs:

<?xml version="1.0" encoding="UTF-8"?>
<Catalogs loadItemName="Catalog">
  <Catalog Delete="0">
    <Identifier>Spring Fashions</Identifier>
    <MasterCatalog>FALSE</MasterCatalog>
    <Description>Spring Fashions</Description>
    <Name>Spring Fashions</Name>
    <ShortDescription>Spring Fashions</ShortDescription>
    <LongDescription>Fashions for the Spring season</LongDescription>
  </Catalog>
  <Catalog Delete="0">
    <Identifier>Fall Fashions</Identifier>
    <MasterCatalog>FALSE</MasterCatalog>
    <Description>Fall Fashions</Description>
    <Name>Fall Fashions</Name>
    <ShortDescription>Fall Fashions</ShortDescription>
    <LongDescription>Fashions for the Fall season</LongDescription>
  </Catalog>
</Catalogs>
  • The first line in the preceding example identifies the file that you are loading as an XML file.
  • The second line is the root element and contains the keyword that corresponds to the catalog business object type to upload. For example, you can specify the Catalog keyword for loading a catalog, or the CatalogEntry keyword for loading catalog entries. You must specify the business object keyword as the loadItemName at this root level. The keyword is case-sensitive.
  • The third line is an example of a second-level element that identifies the objects that are being loaded. For example, the preceding code identifies that a catalog object is being loaded. Identify each object that you are loading in your file at this level. For example, in the preceding code, two catalog objects are being loaded, a Spring Fashions catalog and a Fall Fashions catalog. If you are deleting objects with this file, you can identify whether an object is to be deleted at this level. If the value for the Delete attribute is 1, the catalog object is to be deleted. If the value for the Delete attribute is 0, the catalog object is not to be deleted. If you do not specify a value for the Delete attribute, the value defaults to 0. You can also specify Delete as an element nested within the object element.
  • The elements that are nested within the second level (object) elements contain the object information. For example, the object Identifier or ShortDescription. Within these XML elements, the corresponding value for the catalog object that is being loaded must be included. The names of the object information elements are case-sensitive and must match the CSV column names for the same business object type. The elements must be unique for each object that you are loading with an XML file. For example, you cannot include two ShortDescription elements nested within an object. You can include the information for an object that you are loading as XML elements nested with the object element, or as attributes within the object element. If you are adding your object information as attributes, these XML attributes must be included in the following format:
    <object attribute="attribute_value"> 
    Where object is the object that you are loading, and attribute is the name of the attribute that you are loading. For example,
    <Catalog Identifier="Spring Fashions">
Do not change the first or second line in your XML file, or your data might not load correctly to the database. Use the remaining lines to add your business object information.

For more information about creating files in XML format for the Data Load utility, see Creating data in XML format.

Sample input files

WebSphere Commerce also provides sample files to help you create your input files. Use the CSV or XML files that are referenced in the following samples as a starting point for creating your own input files that follow the correct data format.

You can also use the CSV or XML input files that include keywords for use with the Catalog Upload feature in Management Center to help you create your own input files. You do not need to remove the keywords. For more information, see File format for uploading catalog data.