Create data in CSV format
We can create data for loading into the database with the Data Load utility in a CSV formatted file. The easiest way to create this data is to download a sample CSV file to use as a starting point.
Task info
The following image displays an example of a CSV file we use to load catalog data; this example uploads a sales catalog:In the CSV file:
- The first row contains the keyword that corresponds to the business object we 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 we are loading. For example, the object Identifier or ShortDescription. Important: These column headings are case-sensitive and must match the name that the column maps to within the business object mediator. If the business object configuration file for the object that we are loading includes a mapping for the column, the name must match the name within the configuration file mapping. The configuration file must then map the column to the business object mediator.
- The remaining rows of the file include data values that correspond to the column headings that you include in the file.
Important: If we 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 can contain multiple objects for a particular business object type. For example, we 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, we can combine multiple types of business objects in a single file. For more information about the available component and table object based mediators, see
Procedure
- Download a sample CSV file to use as your starting point. Save the sample CSV file with a new name in a folder on your computer. If we are loading data for a business object type that does not have a sample, create an empty file to include your CSV formatted data. We can download a sample CSV file from a provided Data Load sample. See
Samples: Data Load utility.- Open the CSV file that you downloaded or created. Use a text editor or a spreadsheet editor that can save in UTF-8 format, such as Open Office Calc.
Note: Before you edit the CSV file, ensure that you review the following topic: General data load best practices for CSV input files.
- Optional: Edit the first row in your file to specify a keyword that identifies the type of business object that we are loading. The keyword is optional for the Data Load utility, but we are recommended to include the keyword when one is applicable. By specifying a keyword, we can load the CSV file with the Data Load utility or provide the file to business users to edit and use with the Management Center Catalog Upload feature. When we are specifying a keyword, select one of the following keywords. These keywords are case-sensitive, so ensure that you type the keyword exactly as shown:
- Attachment
- AttachmentAsset
- AttachmentAssetLanguage
- AttachmentDescription
- AttributeDictionaryAttributeAllowedValues
- AttributeDictionaryAttributeAndAllowedValues
- AttributeDictionaryAttributeFolderRelationship
- Catalog
- CatalogDescription
- CatalogGroup
- CatalogGroupAsset
- CatalogGroupAssociation
- CatalogGroupAttachment
- CatalogGroupCalculationCode
- CatalogGroupDescription
- CatalogGroupRelationship
- CatalogGroupSEO
- CatalogEntry
- CatalogEntryAsset
- CatalogEntryAssociation
- CatalogEntryATPInventory
- CatalogEntryAttachment
- CatalogEntryAttributeDictionaryAttributeRelationship
- CatalogEntryCalculationCode
- CatalogEntryComponent
- CatalogEntryDescription
- CatalogEntryDescriptiveAttributeAndValue
- CatalogEntryDescriptionOverride
- CatalogEntryDescriptionUpdate
- CatalogEntryInventory
- CatalogEntryOfferPrice
- CatalogEntryParentCatalogGroupRelationship
- CatalogEntryParentProductRelationship
- CatalogEntrySEO
- CatalogEntryUpdate
- CatalogFilter
- CatalogFilterCategory
- CatalogFilterCatentry
- CatalogFilterCondition
- CatalogFilterConditionGroup
- ListPriceList
- MarketingActivity
- MarketingCampaign
- MarketingContent
- MarketingContentAttachment
- MarketingContentAttachmentDescription
- MarketingContentDescription
- MarketingContentImageMap
- MarketingElement
- MarketingElementNVP
- MarketingSpot
- MarketingSpotDefaultContent
- MarketingSpotDefaultTitle
- MemberGroup
- MemberGroupCondition
- MemberGroupDescription
- Offer
- ProductDefiningAttributeAndAllowedValues
- SKUDefiningAttributeValue
- Optional: In the second row, edit the column headers that are for identifying the data for a business object. Add or remove any optional column headings to match the data values that we are loading. For more information about the columns that we can specify for any supported types of business objects, see the topics under the Data Load utility CSV column and XML element definitions topic. If we are creating a CSV file for a custom business object type, or loading multiple types of business objects, the column headings must match the column mappings in your business object configuration file.
- Delete the sample data in the third row and all subsequent rows of data in your copied sample CSV file.
- Starting with the third row, specify the values for our business objects in the mandatory and optional columns. Separate the value for each column with the appropriate delimiter characters. Notes:
- Each column value must be separated with the expected token delimiter character. By default, this character is a comma ( , ).
- If we are specifying a string that includes spaces or special characters as a column value, enclose the string in the configured token value delimiter character. This delimiter is used to indicate the beginning and the end of a string. The default tokenValueDelimiter character is the double quotation mark ("). As an example, the following string includes commas and white spaces and is enclosed in the tokenValueDelimeter:
"Men's fashions for business, casual, and formal occasions"
- To indicate the end of the record for an object and to begin a new object record, include the line, or record, delimiter character. By default, this delimiter character is the newline character. With this default configuration, the CSV data reader reads each line in the file as a separate object record. If you include data for a column or record across multiple lines in your file, we can encounter errors or issues with the load process or with your data. If we want data for a column to span multiple lines, enclose the data within the configured tokenValueDelimiter characters. If we want data for an entire record to span multiple lines we must configure a new record delimiter to identify the end of each record.
For more information about the delimiter characters that we can use with the CSV data reader and to configure multiple-line records, see Configure the CSV data reader.
- Save your CSV file.
Results
The CSV file is created in a suitable format for use with the Data Load utility. When you load the file, the keyword and the column headers are interpreted but are not loaded into the database.