← All nodes
Unstructured Text

Trim Text

Remove spaces and tabs from the beginning and end of each line, while leaving the spacing inside lines alone.

When to use it

Typical uses: Cleaning spreadsheet columns before matching or looking up values; Removing indentation from copied code or quotes; Preparing tags, keywords or IDs for import.

In a pipeline

Settings

SettingTypeRequiredDefault or hint
Text columnselect—Text
Generate New Columncheckbox—false
New Column Nametext—Default: <column> Result
Insert Afterselect—After the column
When a value cannot be convertedselect—stop

Example

Trim Text: an example

    Text arriving
    Text
    indented line trailing spaces here tabbed and spaced
    The text after this node
    Text
    indented line trailing spaces here tabbed and spaced

    Worth knowing

    • Does trimming remove blank lines? No. Blank lines stay, but any spaces on them are removed. Use Remove Empty Lines to delete them.
    • Is the space between words changed? No. Only whitespace at the very start and end of each line is removed.
    • What is the difference from Remove Extra Spaces? Trim Text only touches the edges of each line. Remove Extra Spaces also collapses repeated spaces inside lines.
    • Works on any text column, not only Text Input's: pick it under Text column. Tick Generate New Column to keep the original next to the result.

    Others in Unstructured Text