Shample Intel
Menu
Catalog quality guide

Skip catalog titles without treating them as product rows

Reproduce third-record header detection and compare source row counts with parsed data instead of manually deleting every title line.

File formatsUpdated Guide slug: detect-csv-header-after-preamble

The issue to look for

A catalog export may begin with a title or an explanatory record. Assuming the first record is the header can produce missing-column errors or a one-column file that looks empty.

What this check can tell you

The fixture reports headerRow 3 and sourceRows 1, demonstrating the detection window and the difference between preamble records and actual inventory rows.

A transparent review

  1. Inspect the first fifteen parsed records, not only the first visible line.
  2. Run the fixture containing two preamble records followed by SKU, UPC and Qty.
  3. Confirm the detected header position and the one retained data record.
  4. If the true header is outside the window or unusual, save a working copy with a clear recognized header near the start.

How to read the result

  • The parser scores recognizable column names in its first fifteen-record window. It needs a meaningful identifier field and consistent record widths after selecting the header.
  • A quoted multiline description is one CSV record even if it spans physical lines. Earlier explanatory text that resembles a header can affect detection, so always review the chosen columns instead of assuming the score proves the layout.

Limits to keep in view

  • The detection window is bounded; it is not a search through an arbitrary document.
  • Irregular product row widths are rejected rather than shifted silently.
  • The example uses fictional generic catalog text, not a proprietary supplier layout.
Illustrative sample

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

Input

Synthetic practice catalog
Prepared for a parser demonstration
SKU,UPC,Qty
PRE-1,012345678905,6

Output

{
  "checks": {
    "totalRows": 1,
    "sourceRows": 1,
    "headerRow": 3,
    "validIdentifiers": 1
  },
  "cleanedRows": [
    {
      "SKU": "PRE-1",
      "UPC": "012345678905",
      "Qty": "6"
    }
  ]
}

Observation: The true header is record 3. Preamble records do not become products; the single data record is checked.

Download synthetic fixture

Sources