reject
for filters> reject {flags} ...rest
...rest
: the names of columns to remove from the tableinput | output |
---|---|
record | record |
table | table |
Reject a column in the ls
table
>ls|rejectmodified
Reject a column in a table
> [[a, b]; [1, 2]] |rejecta
╭───┬───╮
│# │ b │
├───┼───┤
│0│2│
╰───┴───╯
Reject a row in a table
> [[a, b]; [1, 2] [3, 4]] |reject1
╭───┬───┬───╮
│# │ a │ b │
├───┼───┼───┤
│0│1│2│
╰───┴───┴───╯
Reject the specified field in a record
> {a:1, b:2} |rejecta
╭───┬───╮
│b│2│
╰───┴───╯
Reject a nested field in a record
> {a: {b:3, c:5}} |rejecta.b
╭───┬───────────╮
││╭───┬───╮│
│a││c│5││
││╰───┴───╯│
╰───┴───────────╯
Reject columns by a provided list of columns
>letcols= [sizetype];[[nametypesize]; [Cargo.tomltoml1kb] [Cargo.locktoml2kb]] |reject$cols
Reject rows by a provided list of rows
>letrows= [02];[[nametypesize]; [Cargo.tomltoml1kb] [Cargo.locktoml2kb] [file.jsonjson3kb]] |reject$rows
To remove a quantity of rows or columns, use skip
, drop
, or drop column
.
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/reject.html