{
  "slug": "field-extractor",
  "name": "gizza-ai/field-extractor",
  "version": "0.1.0",
  "title": "Field Extractor — Cut Columns & Character Ranges from Text — gizza.ai",
  "description": "Extract columns or character ranges from every line of text. 1-based selectors with negative indices, ranges, reordering, custom delimiters. A browser cut/awk, no upload.",
  "tags": [
    "field extractor",
    "extract column from text",
    "cut columns",
    "awk online",
    "text column extractor",
    "delimited column extractor",
    "character range extract",
    "negative column index",
    "reorder columns",
    "split text columns"
  ],
  "category": "text",
  "urls": {
    "page": "https://gizza.ai/tools/field-extractor/",
    "markdown": "https://gizza.ai/tools/field-extractor/index.md",
    "descriptor": "https://gizza.ai/tools/field-extractor/tool.json",
    "deep_link_example": "https://gizza.ai/tools/field-extractor/?text=alice%2030%20engineer%0Abob%2025%20designer%0Acarol%2041%20writer&mode=fields&selectors=1%2C3%20%20or%20%202-4%20%20or%20%20-1&delimiter=blank%2C%20comma%2C%20%7C%2C%20%3A%3A%2C%20%5Ct&output_delimiter=blank%2C%20comma%2C%20%5Ct%2C%20newline&trim=true&skip_empty_lines=true&skip_header=true"
  },
  "cli": "gizza tool field-extractor \"alice 30 engineer\nbob 25 designer\ncarol 41 writer\" 'selectors=1,3  or  2-4  or  -1'",
  "tool": {
    "description": "Extract specific fields or character ranges from every line of text, a friendly cut/awk replacement. In 'fields' mode split each line by a delimiter (blank = collapse whitespace) and pick columns with 1-based selectors that support negative indices (-1 = last field), ranges (2-4), reversed ranges (4-2), open-ended ranges (3-), and reordering (3,1,2). In 'chars' mode extract character positions (Unicode code-point safe). Options: custom multi-character/escaped delimiters, an output delimiter, trim, skip empty lines, and skip a header row. Returns the extracted text.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "delimiter": {
          "default": "",
          "description": "Field delimiter for 'fields' mode. Blank (default) collapses runs of whitespace (like awk). Accepts multi-character strings, keyword names (tab, comma, pipe, semicolon, colon, space), and backslash escapes (\\t, \\n). Ignored in 'chars' mode.",
          "type": "string"
        },
        "mode": {
          "default": "fields",
          "description": "What to extract: 'fields' (default) splits each line into columns by the delimiter; 'chars' extracts character positions from each line (Unicode code-point safe, like cut -c).",
          "enum": [
            "fields",
            "chars"
          ],
          "type": "string"
        },
        "output_delimiter": {
          "default": "",
          "description": "Delimiter used to join the extracted pieces. Blank (default) reuses the input delimiter in 'fields' mode (a single space when whitespace-splitting) and concatenates in 'chars' mode. Accepts keyword names and \\t/\\n escapes; 'newline' puts each piece on its own line.",
          "type": "string"
        },
        "selectors": {
          "description": "1-based selectors, comma-separated. A term is a single index (1, 3), a negative index counting from the end (-1 = last, -2 = second-to-last), a range (2-4), a reversed range (4-2), or an open-ended range (3- = from field 3 to the end). Endpoints may be negative (-3--1). Terms emit in the order given, so 3,1,2 reorders.",
          "type": "string"
        },
        "skip_empty_lines": {
          "default": false,
          "description": "Drop blank or whitespace-only input lines instead of emitting an empty output line. Default false.",
          "type": "boolean"
        },
        "skip_header": {
          "default": false,
          "description": "Drop the first line of input (a header row) before extracting. Default false.",
          "type": "boolean"
        },
        "text": {
          "description": "Input text, one record per line.",
          "type": "string"
        },
        "trim": {
          "default": false,
          "description": "Trim surrounding whitespace from each extracted field ('fields' mode). Default false.",
          "type": "boolean"
        }
      },
      "required": [
        "text",
        "selectors"
      ],
      "type": "object"
    }
  }
}