File Preparation

CSV, Excel & XML Formatting Guidelines

Best practices for UTF-8 character encoding, multi-row delimiters, Excel formulas, and JSON hierarchies.

Frexten Engineering Team
Updated 2026-11-20

Article Overview

  • Category: Data Preparation, File Formats & Sanitization
  • Audience: Catalog Managers, Data Entry Specialists & Developers
  • Applies To: NextGen Smart Data Importer (Community Free & Enterprise Pro Editions)
  • Purpose: Formatting specifications for CSV, Excel (.xlsx, .xls), and XML feeds to guarantee 100% clean imports without encoding corruption or delimiter errors.

1. Executive Summary

Data files exported from legacy ERPs, suppliers, and spreadsheet applications (Microsoft Excel, Google Sheets, Apple Numbers) frequently suffer from encoding corruptions (Mojibake), unescaped commas, inconsistent line breaks, or complex nested JSON arrays.

NextGen Smart Data Importer features an Intelligent File Normalization Engine that automatically detects:

  • Character Encoding: UTF-8, UTF-8 with BOM, UTF-16, ISO-8859-1 (Latin1), and Windows-1252.
  • Delimiters: Comma (,), Semicolon (;), Tab (\t), Pipe (|), or Caret (^).
  • Nested Values: Pipe-separated image lists, multi-dimensional categories, and JSON-encoded custom fields.

Following the best practices outlined below ensures zero rejected rows and instantaneous auto-mapping.


2. Character Encoding & The UTF-8 Standard

The Golden Rule: Save as CSV UTF-8 (Comma delimited)

Special characters like currency symbols (€, £, ¥), accented letters (é, ñ, ü), smart quotes (“, ”), and international alphabets (Arabic, Cyrillic, Chinese, Japanese, Hindi) require UTF-8 encoding.

Architecture Flowchart
flowchart TD RawFile["Incoming Spreadsheet"] --> BOMCheck{"BOM (Byte Order Mark) Detected?"} BOMCheck -- "Yes (EF BB BF)" --> StripBOM["NextGen Strips BOM automatically"] BOMCheck -- "No" --> ReadStream["Stream raw UTF-8 bytes"] StripBOM --> Normalizer["Normalize Line Endings (\r\n ➔ \n)"] ReadStream --> Normalizer Normalizer --> CleanData["Clean WordPress Post Content & Taxonomy Terms"]

How to Save as UTF-8 in Excel

  1. Open your workbook in Microsoft Excel.
  2. Click File ➔ Save As.
  3. In the file format dropdown, select CSV UTF-8 (Comma delimited) (*.csv) (avoiding standard "CSV (Comma delimited)" which defaults to Windows ANSI).

3. Delimiters, Multi-Value Fields & Array Lists

When importing WooCommerce product galleries, multi-category hierarchies, or custom tags, a single spreadsheet cell often contains multiple items.

NextGen natively parses multiple items within a single column using standard delimiter conventions:

Data Type Column Sample How NextGen Treats It
Product Image Gallery https://cdn.com/1.jpg | https://cdn.com/2.jpg | https://cdn.com/3.jpg Downloads all 3 images and populates _product_image_gallery.
Nested Taxonomies Clothing > Men's Apparel > Jackets Recursively builds parent/child category relationships automatically.
Multiple Tags summer, sale, waterproof, outdoor Creates and assigns 4 distinct taxonomy terms.
JSON Metadata {"color": "Navy", "material": "100% Wool", "size": "42R"} Deserializes into individual ACF or Postmeta fields.

4. XML Feed Structure & Node Traversal

For XML imports (real estate MLS feeds, supplier catalogs, affiliate data), NextGen traverses repeating node structures:

xml
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
    <product>
        <sku>JACKET-BLU-42</sku>
        <title><![CDATA[Men's Classic Wool Bomber]]></title>
        <price>189.99</price>
        <images>
            <image>https://cdn.supplier.com/img1.jpg</image>
            <image>https://cdn.supplier.com/img2.jpg</image>
        </images>
        <categories>
            <category>Men</category>
            <category>Outerwear</category>
        </categories>
    </product>
</catalog>
  • Repeating Record Element: In Step 1, select the repeating node (<product>).
  • CDATA Wrapping: Always wrap rich-text HTML descriptions in <![CDATA[ ... ]]> to prevent XML parser syntax errors.

5. Developer Checklist for Clean File Preparation

text
┌────────────────────────────────────────────────────────────────────────────────────────┐
│  DATA SANITIZATION CHECKLIST                                                           │
├────────────────────────────────────────────────────────────────────────────────────────┤
│  [✓] Character Encoding: File is saved as UTF-8 (No ANSI or Windows-1252 corruption)  │
│  [✓] Header Row: Row 1 contains unambiguous, unique column names (e.g., Title, SKU)    │
│  [✓] Delimiter Consistency: Semicolons or commas are consistently used throughout      │
│  [✓] Image URLs: URLs include complete protocols (https://) and valid file extensions  │
│  [✓] Quotes & Commas: Cells containing commas are wrapped in standard double quotes    │
└────────────────────────────────────────────────────────────────────────────────────────┘

6. Frequently Asked Questions (FAQ)

Q: Why do my prices import with missing decimals (e.g. $1999 instead of $19.99)?

This occurs when European spreadsheets use commas as decimal separators (19,99). In Step 2 (Field Mapping), enable the "Normalize European Decimal Comma" toggle, and NextGen will automatically convert 19,99 to 19.99 during database ingestion.

Q: Does NextGen support huge Excel files (.xlsx) with multiple sheets?

Yes. NextGen inspects multi-sheet Excel workbooks and provides a dropdown in Step 1 letting you choose which sheet to import.