Shample Intel
Menu
Catalog quality guide

Remove outer UPC formatting without changing its digits

Test trimming surrounding whitespace and one leading spreadsheet apostrophe, with a visible before/after repair record.

IdentifiersUpdated Guide slug: trim-upc-whitespace-apostrophes

The issue to look for

An identifier copied from a spreadsheet may include surrounding spaces or an apostrophe used to force text entry. These characters are different from missing numeric data.

What this check can tell you

The fixture preserves the raw quoted input for comparison and demonstrates the exact formatting cleanup used by the shared analyzer.

A transparent review

  1. Inspect the raw field in a text editor; do not confuse CSV quote delimiters with characters inside a cell.
  2. Run the fixture and compare the spaced, apostrophe-prefixed value with 012345678905.
  3. Review the formatting repair before accepting the cleaned column.
  4. Investigate interior punctuation separately rather than broadening this rule.

How to read the result

  • The analyzer trims the outside of the field, then removes one apostrophe only when it is immediately followed by a digit. It checks the remaining identifier against supported lengths and check digits.
  • This cleanup can happen even with zero inference disabled because the repairUpcs option controls inferred padding, not all whitespace normalization. It should not be described as an immutable raw export mode.

Limits to keep in view

  • Interior spaces and hyphens in GTINs are not stripped.
  • Repeated apostrophes or an apostrophe before a letter are not covered by the digit-prefix rule.
  • A formatting repair does not verify product identity or allocation.
Illustrative sample

Synthetic fixture: synthetic-edge-formatting.csv

This small synthetic example makes the transformation and observation visible. It is an educational illustration, not a claim that a supplier file or external registry was verified.

Fixture ID
edge-formatting
Published fixture reference
edge-formatting
Filename
synthetic-edge-formatting.csv
Encoding
UTF-8
Options
{"repairUpcs":true,"removeZeroStock":false,"removeZeroCost":false}

Input

UPC,SKU
"  '012345678905  ",EDGE-1

Output

{
  "checks": {
    "validIdentifiers": 1,
    "repairCount": 1
  },
  "cleanedRows": [
    {
      "UPC": "012345678905",
      "SKU": "EDGE-1"
    }
  ]
}

Observation: Outer whitespace and one spreadsheet apostrophe before digits are removed. No product identity is verified by that formatting change.

Download synthetic fixture

Sources