LiteCommerce:Import/Export Procedures and CSV File Format

From X-Cart 4 Classic
Revision as of 18:45, 14 January 2010 by Admin (talk | contribs) (Created page with 'LiteCommerce software allows exporting your store data (including user details, product details, tax schemes and more) from the database into a file on your hard drive, and impor…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

LiteCommerce software allows exporting your store data (including user details, product details, tax schemes and more) from the database into a file on your hard drive, and importing the data from a file.

The file format used to import/export data is called CSV format, where CSV stands for 'Comma Separated Values'. CSV file is a text file where each line represents a separate record consisting of the record fields separated by a designated delimiter. When exporting data from the database, only string and numeric values can be saved to a CSV file, while formatting, graphics and other complex data objects cannot. While the name of the format implies that fields must be delimited by a comma, LiteCommerce allows choosing alternative delimiter: a semicolon or tabulation. If one of the fields contains the delimiter symbol as part of its value, the whole field must be enclosed in text qualifier symbols (you can choose whether to use single or double quotes as a text qualifier). If a text field contains the symbol used as a text qualifier, the symbol must be doubled to be considered a symbol rather than end of the string marking.

Important: Do not use '/' symbol in category names, since this symbol is used as a separator between categories and subcategories.

Examples

The following is a correct CSV record string with a comma delimiter and double-quote text qualifier:

John Doe,”1 Main street, Sunny Town, NJ”,doe@example.com,1,0,customer

Same data with a semicolon delimiter will look like the string below:

John Doe;1 Main street, Sunny Town, NJ;doe@example.com;1;0;customer
Note: While text qualifier marks are not required in the fields that do not contain the delimiter symbol, it is always better to use them with text strings to avoid problems.

In the following example, note the first field which contains double quotes in the title of the movie:

“””Crazy/beautiful”" movie”,”Movies/DVD”,100,19.95

When exporting database data into a CSV file, LiteCommerce creates a file with a unique name on your local computer. The file can be edited using MS Excel or any other datasheet software that is capable of working with data in CSV format.

When importing data from a CSV file, the file must either be stored on your local computer or uploaded to the server in advance. In the first case, proceed to the 'File (CSV) for upload' field and click on the 'Browse…' button to locate the file on your computer. If the file is already located at the server, enter its location (relative to the upload directory) and name in the 'File (CSV) local' field.

In most cases when importing records you have an option to drop data (clean-up the corresponding database tables) prior to importing, or append the imported records to existing data. If you choose to clean up the database, please note that this operation can not be undone and the corresponding data will be lost unless you have made a backup of your database.