Skip to content

The Table: Split Text step splits the text in one column at a separator and writes the pieces as new columns or as new rows. The number of columns is decided when the step runs, from the value with the most pieces, so you don’t need to know it in advance.

  • Source Table and Output Table — the table to read and the table to write.
  • Column to split — the column to split. A number is split as its text.
  • Separator — the literal text between pieces. It can be any length and is not a pattern. Spaces are kept as typed.
  • Split into — Columns or Rows.
    • Columns writes <column>_1, <column>_2, and so on, as many as the value with the most pieces. A value with fewer pieces gets NULL in the rest.
    • Rows writes one row per piece, with the piece in place of the column. Empty pieces stay as rows.
  • Trim spaces around each piece — on by default.
  • Keep the original column — on by default. In columns mode it keeps the split column. In rows mode it also writes the unsplit value to <column>_original.

An empty result replaces the output table. It never leaves rows from an earlier run.

More Split Options also has these settings when splitting into columns:

  • Piece Name Prefix (prefix) — name the pieces <prefix><n> instead of <column>_<n>. Number of the First Piece (start, default 1) is the number of the first piece.
  • Piece Column Names (names) — the names of the piece columns, in order. Exactly that many columns are written, unless you turn on Write only as many named columns as the longest value has (fit): then only as many as the value with the most pieces has.
  • Piece Type (dtype) — the type of the pieces: text (default), integer, bigint, double, boolean, date or timestamp. A piece that does not read as that type is NULL.
  • Characters to Strip (strip) — the characters taken off both ends of each piece, instead of the spaces Trim spaces around each piece removes.
  • The column holds a KNIME collection (collection) — the column holds a list value from a converted KNIME workflow. Its elements are the pieces and the separator is not used: a missing element is NULL, and an empty list has no pieces.

KNIME Node (knime_config) runs one of KNIME’s Line Chopper, Expand Vector, or Sample and Expand Vector nodes with this step: chopper writes the first whitespace-separated tokens of a column, expand_vector writes the elements of a vector column as columns, with the positions to keep listed in the table Element Positions Table (source_b), and sample_expand_vector expands a random sample of the elements, writing the sampled column names to the table in Sampled Column Names Table (targets).