Impex Formatter
Format and validate SAP Commerce Impex files with proper structure
Format Impex
Formatted Output
Examples
Basic Impex
Basic Impex structure with simple data
INSERT_UPDATE Product;code[unique=true];name;description
;product001;Sample Product;This is a sample...With Headers
Impex with headers and complex data
# Import products with categories
INSERT_UPDATE Product;code[unique=true];name;description;category(...Complex Structure
Complex Impex with multiple types and references
# Complex Impex example
INSERT_UPDATE Product;code[unique=true];name;description;category(code);pric...Quick Tips
- Paste your Impex content in the input area
- Click Format to beautify the structure
- Use Validate to check syntax
- Copy or download the formatted result
Impex Formatter
Format and validate SAP Commerce Impex files with proper structure
Features
- Format SAP Commerce ImpEx files (.impex / .csv variants) with proper indentation, header alignment, and consistent semicolon separators — the canonical style used in SAP's reference projects
- Smart header alignment: $contentCatalog, $catalogVersion, and other macro definitions get aligned to the same column for readable diffs; INSERT/UPDATE/REMOVE headers align with their data lines
- Validation pass: unbalanced quotes, missing required type attributes, line continuation errors (\\ at end of line), invalid macro syntax — each finding includes line/column and a suggestion
- Minify mode for embedding ImpEx in JSON or scripts: collapses indentation while preserving line breaks (ImpEx is line-significant — minification can't safely join lines)
- Statistics panel: total INSERT/UPDATE/REMOVE counts, type name occurrences, macro definitions count — useful for review scope estimation
- Per-header detection: $START_USERRIGHTS, $contentCatalog, $catalogVersion, $contentCV, $catalogCV, $lang macros recognized; their values shown in a dedicated panel for quick inspection
- Comment preservation toggle: keep # single-line comments through formatting (default on; turn off when minifying for production-bound scripts)
- Pure client-side: parsing and formatting run in your browser, no upload. Safe for ImpEx files that reference proprietary catalog names or test data
How to use
- Paste your ImpEx file content into the input pane.
- Choose formatting options: indent size, header alignment, comment preservation.
- Click Format. The output pane shows the formatted ImpEx with statistics and validation results below.
- Inspect the validation findings — each error/warning points to a specific line.
- Toggle Minify mode for compact output suitable for embedding in scripts.
- Copy or download the result; the downloaded file uses .impex extension.
Tips & Best Practices
- Always run validation before importing into production; even small syntax errors abort the entire batch.
- Use macros liberally for repeated values ($lang=en, $catalogVersion=Online) — easier to maintain and review.
- Header order matters when columns have [unique=true] modifiers; the formatter preserves order, never reorders.
- For shared SAP projects, agree on header-alignment style in your team and run the formatter pre-commit.
- When inheriting old ImpEx, run a format-only pass first to normalize style, then review diff before functional changes.
FAQ
What does header alignment do exactly?
ImpEx headers like INSERT_UPDATE Product;code[unique=true];name[lang=en];price look better when fields are vertically aligned across rows: the unique-keyed columns line up, attribute modifiers like [unique=true] / [lang=en] align, and the resulting file diffs more cleanly. Header alignment computes the max width of each column and pads accordingly.
Why does minify warn about line continuation?
ImpEx uses backslash at end-of-line for continuation: a row can span multiple lines if each non-last line ends with \\. Minify can't collapse these into one line because doing so would change semantics for some ImpEx parsers. The minifier preserves line breaks within continued rows.
Does the formatter understand $macro definitions?
Yes. Macros like $contentCatalog=electronics, $catalogVersion=Staged, $lang=en are recognized as definition lines; their values are extracted into the macro-summary panel. They're also kept aligned with similar macros at the top of the file (SAP convention).
How does validation handle escaped semicolons?
\\; (escaped semicolon) inside a value is preserved as part of the value — not treated as a field separator. The validator counts fields based on unescaped semicolons. If you see field-count mismatches, check for unescaped semicolons in your data values.
Why is INSERT_UPDATE flagged when I expected just INSERT?
INSERT_UPDATE is the safe default for idempotent imports — it inserts if not present, updates if found. INSERT fails if the row already exists, useful for strict creation. The formatter doesn't flag either; the choice is yours, but most SAP projects use INSERT_UPDATE.
Can it format CSV that looks like ImpEx?
If the first non-comment line starts with a recognized header (INSERT_UPDATE, INSERT, UPDATE, REMOVE), yes — it's treated as ImpEx and formatted. Pure CSV without ImpEx headers should use the CSV ↔ JSON Converter tool instead.
Is my ImpEx sent anywhere?
No. Parsing happens locally in your browser; no upload, no logging, works offline once cached. Safe for ImpEx files containing customer-facing copy or competitive catalog data.
Does it understand cross-references via PK?
It validates ImpEx syntax — semicolons, headers, quoting — but doesn't resolve cross-references (e.g. that productCode "X" referenced by Order_X exists in the same import). Use SAP Commerce's validation step (hac/console.zul) for cross-reference resolution.