{
  "slug": "csv-whitespace-normalizer",
  "name": "gizza-ai/csv-whitespace-normalizer",
  "version": "0.1.0",
  "title": "CSV Whitespace Normalizer — Trim and Collapse Cell Spaces — gizza.ai",
  "description": "Paste a CSV or TSV to trim every cell, collapse or remove the spaces inside values, and clean up non-breaking spaces. Runs locally in your browser.",
  "tags": [
    "csv whitespace normalizer",
    "trim csv columns",
    "remove extra spaces csv",
    "collapse whitespace",
    "non-breaking space",
    "csv cleaning",
    "tsv trim",
    "data quality"
  ],
  "category": "data",
  "urls": {
    "page": "https://gizza.ai/tools/csv-whitespace-normalizer/",
    "markdown": "https://gizza.ai/tools/csv-whitespace-normalizer/index.md",
    "descriptor": "https://gizza.ai/tools/csv-whitespace-normalizer/tool.json",
    "deep_link_example": "https://gizza.ai/tools/csv-whitespace-normalizer/?input=name%2Ccity%2Csku%0A%20%20Ada%20%20%20Lovelace%20%2C%20New%20%20%20York%20%2C%20%20AB%2012%20%20CD%20%0AGrace%20Hopper%2CBerlin%20%2CXY34&delimiter=comma&trim=both&internal=collapse&whitespace=unicode&columns=sku&header=true&normalize_header=true"
  },
  "cli": "gizza tool csv-whitespace-normalizer \"name,city,sku\n  Ada   Lovelace , New   York ,  AB 12  CD \nGrace Hopper,Berlin ,XY34\"",
  "tool": {
    "description": "Normalize the whitespace inside every cell of a CSV/TSV table. Unlike a plain trim, this also fixes the INTERIOR of a value: 'Ada   Lovelace' becomes 'Ada Lovelace', and with internal = 'remove', 'AB 12 CD' becomes 'AB12CD'. Padding is what silently breaks joins, VLOOKUPs, GROUP BYs and duplicate checks, because ' Berlin' and 'Berlin' are different keys. The pass runs inside a real RFC 4180 parse, so quoting, embedded separators and embedded newlines never break a record, the field separator round-trips, and ragged rows keep their length. By default whitespace means the full Unicode White_Space set — non-breaking space (U+00A0), narrow NBSP (U+202F), ideographic space (U+3000) and friends, exactly the characters that survive a copy-paste from a spreadsheet or a web page — set whitespace = 'ascii' to leave those as content. trim picks the ends to strip ('both' (default), 'leading', 'trailing', 'none'); internal picks the interior treatment ('collapse' (default), 'remove', 'keep' for a pure trim); columns limits the pass to named, positional or ranged columns ('name,city', '1,3-5'); header marks row 1 as a header and normalize_header (default on) decides whether it is rewritten too. Only whitespace changes — no cell is retyped, reordered, dropped or invented. Runs entirely in the sandbox; nothing is uploaded.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "columns": {
          "default": "",
          "description": "Restrict the pass to specific columns: a comma-separated list of column names (needs header = true), 1-based positions, and inclusive ranges, e.g. 'name,city' or '1,3-5'. Default (empty) normalizes every column. A token that parses as a number or a range is read as a position, so a header literally named '3' must be selected by its position.",
          "type": "string"
        },
        "delimiter": {
          "default": ",",
          "description": "Field separator: 'auto' to sniff it from the first line, a single character, or a name ('comma' (default), 'tab', 'semicolon', 'pipe'). The output uses the same separator as the input.",
          "type": "string"
        },
        "header": {
          "default": true,
          "description": "When true (default), the first row is a header: it supplies the names used by the columns option. Turn it off for a headerless table, where row 1 is data like any other.",
          "type": "boolean"
        },
        "input": {
          "description": "The CSV/delimited table to normalize, as text. Quoted fields with embedded separators or newlines (RFC 4180) are preserved. Rows may be ragged — a short row stays short. Max 5,000,000 bytes.",
          "type": "string"
        },
        "internal": {
          "default": "collapse",
          "description": "What happens to whitespace BETWEEN the first and last non-whitespace character of a cell: 'collapse' (default) turns every run into one plain space, so 'Ada   Lovelace' becomes 'Ada Lovelace'; 'remove' deletes it, so 'AB 12 CD' becomes 'AB12CD' (for SKUs, IBANs, part numbers); 'keep' preserves interior spacing byte-for-byte, making this a pure trim.",
          "enum": [
            "collapse",
            "remove",
            "keep"
          ],
          "type": "string"
        },
        "normalize_header": {
          "default": true,
          "description": "When true (default), header cells get the same whitespace pass as the data, which is what makes ' first name ' load as 'first name'. Turn it off to copy the header row through byte-for-byte. Has no effect when header is false.",
          "type": "boolean"
        },
        "trim": {
          "default": "both",
          "description": "Which end(s) of a cell lose their whitespace: 'both' (default), 'leading' (start only), 'trailing' (end only), or 'none' to leave both edges alone and rewrite only the interior. An edge run that survives is copied verbatim.",
          "enum": [
            "both",
            "leading",
            "trailing",
            "none"
          ],
          "type": "string"
        },
        "whitespace": {
          "default": "unicode",
          "description": "Which characters count as whitespace: 'unicode' (default) is the full Unicode White_Space set, so a non-breaking space (U+00A0), narrow NBSP (U+202F) or ideographic space (U+3000) pasted out of a spreadsheet is normalized too; 'ascii' restricts it to space, tab, newline, carriage return and form feed, leaving NBSP and friends as content. Zero-width characters (U+200B, U+FEFF) are not whitespace under either setting.",
          "enum": [
            "unicode",
            "ascii"
          ],
          "type": "string"
        }
      },
      "required": [
        "input"
      ],
      "type": "object"
    }
  }
}