Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

skip until for filters

Skip elements of the input until a predicate is true.

Signature

> skip until {flags} (predicate)

Parameters

  • predicate: The predicate that skipped element must not match.

Input/output types:

inputoutput
list<any>list<any>
tabletable

Examples

Skip until the element is positive

> [-2 0 2 -1] | skip until {|x| $x > 0 }
╭───┬────╮
│ 0 │  2 │
│ 1 │ -1 │
╰───┴────╯

Skip until the element is positive using stored condition

> let cond = {|x| $x > 0 }; [-2 0 2 -1] | skip until $cond
╭───┬────╮
│ 0 │  2 │
│ 1 │ -1 │
╰───┴────╯

Skip until the field value is positive

> [{a: -2} {a: 0} {a: 2} {a: -1}] | skip until {|x| $x.a > 0 }
╭───┬────╮
│ # │ a  │
├───┼────┤
│ 0 │  2 │
│ 1 │ -1 │
╰───┴────╯