skip while
for filters> skip while {flags} (predicate)
predicate
: the predicate that skipped element must matchinput | output |
---|---|
list<any> | list<any> |
table | table |
Skip while the element is negative
> [-202-1] |skip while {|x| $x<0 }
╭───┬────╮
│0│0│
│1│2│
│2│-1│
╰───┴────╯
Skip while the element is negative using stored condition
>letcond= {|x| $x<0 }; [-202-1] |skip while$cond
╭───┬────╮
│0│0│
│1│2│
│2│-1│
╰───┴────╯
Skip while the field value is negative
> [{a:-2} {a:0} {a:2} {a:-1}] |skip while {|x| $x.a<0 }
╭───┬────╮
│# │ a │
├───┼────┤
│0│0│
│1│2│
│2│-1│
╰───┴────╯
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/skip_while.html