Shample Intel
Menu
Catalog quality guide

Preserve MPN punctuation while reviewing malformed GTINs

Test a hyphenated UPC and a spaced MPN. See why the app retains GTIN punctuation for review but normalizes only MPN whitespace.

IdentifiersUpdated Guide slug: gtin-hyphens-versus-mpn-punctuation

The issue to look for

Applying one punctuation-stripping rule to every identifier column can damage manufacturer part numbers. A hyphen can be meaningful in an MPN even when it is invalid in a numeric GTIN.

What this check can tell you

One downloadable row exercises both paths: the GTIN stays invalid while the MPN becomes Ab-12 Rev.B without losing its case or punctuation.

A transparent review

  1. Confirm which column is a GTIN and which is an MPN before normalization.
  2. Run the fixture and inspect the unchanged 012-345-678905 value.
  3. Compare the MPN before/after: only outer and repeated whitespace changes.
  4. Correct GTIN punctuation only against a documented source rule; retain the original alongside any reviewed correction.

How to read the result

  • The numeric validator does not delete interior spaces or hyphens. This avoids presenting an aggressively reformatted identifier as a verified match.
  • For MPNs, the app trims the ends and collapses repeated whitespace. It does not uppercase, lowercase, or remove punctuation. Duplicate matching is a separate review mechanism and should not be assumed to merge every similarly formatted MPN.

Limits to keep in view

  • A normalized MPN is not checked against a manufacturer database.
  • GTIN punctuation cleanup is not automatic.
  • A repeated identifier can represent different supplier rows or packs that need human review.
Illustrative sample

Synthetic fixture: synthetic-punctuation.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
punctuation
Published fixture reference
punctuation
Filename
synthetic-punctuation.csv
Encoding
UTF-8
Options
{"repairUpcs":true,"removeZeroStock":false,"removeZeroCost":false}

Input

UPC,MPN,SKU
012-345-678905,"  Ab-12   Rev.B  ",PUNC-1

Output

{
  "checks": {
    "invalidIdentifiers": 1,
    "repairCount": 1
  },
  "cleanedRows": [
    {
      "UPC": "012-345-678905",
      "MPN": "Ab-12 Rev.B",
      "SKU": "PUNC-1"
    }
  ]
}

Observation: The hyphenated GTIN stays invalid. MPN whitespace collapses to Ab-12 Rev.B while case, the hyphen and the period remain.

Download synthetic fixture

Sources