skip until
for filters> skip until {flags} (predicate)
predicate
: the predicate that skipped element must not matchinput | output |
---|---|
list<any> | list<any> |
table | table |
Skip until the element is positive
> [-202-1] |skip until {|x| $x>0 }
╭───┬────╮
│0│2│
│1│-1│
╰───┴────╯
Skip until the element is positive using stored condition
>letcond= {|x| $x>0 }; [-202-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│
╰───┴────╯
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/skip_until.html