W3cubDocs

/Nushell

reject for filters

Remove the given columns or rows from the table. Opposite of `select`.

Signature

> reject {flags} ...rest

Parameters

  • ...rest: the names of columns to remove from the table

Input/output types:

input output
record record
table table

Examples

Reject a column in the ls table

>ls|rejectmodified

Reject a column in a table

> [[a, b]; [1, 2]] |rejecta
╭───┬───╮
# │ b │
├───┼───┤
02
╰───┴───╯

Reject a row in a table

> [[a, b]; [1, 2] [3, 4]] |reject1
╭───┬───┬───╮
# │ a │ b │
├───┼───┼───┤
012
╰───┴───┴───╯

Reject the specified field in a record

> {a:1, b:2} |rejecta
╭───┬───╮
b2
╰───┴───╯

Reject a nested field in a record

> {a: {b:3, c:5}} |rejecta.b
╭───┬───────────╮
╭───┬───╮
ac5
╰───┴───╯
╰───┴───────────╯

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

Notes

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