Spec-Zone.ru › Nushell

split words for strings

Split a string's words into separate rows.

Signature

> split words {flags}

Flags

  • --min-word-length, -l {int}: The minimum word length.
  • --grapheme-clusters, -g: Measure word length in grapheme clusters (requires -l).
  • --utf-8-bytes, -b: Measure word length in UTF-8 bytes (default; requires -l; non-ASCII chars are length 2+).

Input/output types:

input output
string list<string>
list<string> list<list<string>>

Examples

Split the string's words into separate rows.

> 'hello world' | split words
╭───┬───────╮
│ 0 │ hello │
│ 1 │ world │
╰───┴───────╯

Split the string's words, of at least 3 characters, into separate rows.

> 'hello to the world' | split words --min-word-length 3
╭───┬───────╮
│ 0 │ hello │
│ 1 │ the   │
│ 2 │ world │
╰───┴───────╯

A real-world example of splitting words.

> http get https://www.gutenberg.org/files/11/11-0.txt | str downcase | split words --min-word-length 2 | uniq --count | sort-by count --reverse | first 10

Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/split_words.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API