move for filters
Moves columns relative to other columns or make them the first/last columns. Flags are mutually exclusive.
Signature
> move {flags} ...rest
Flags
-
--after {string}: The column that will precede the columns moved. -
--before {string}: The column that will be the next after the columns moved. -
--first: Makes the columns be the first ones. -
--last: Makes the columns be the last ones.
Parameters
-
...rest: The columns to move.
Input/output types:
| input | output |
|---|---|
| record | record |
| table | table |
Examples
Move a column before the first column.
> [[name value index]; [foo a 1] [bar b 2] [baz c 3]] | move index --before name ╭───┬──────┬───────╮ │ # │ name │ value │ ├───┼──────┼───────┤ │ 1 │ foo │ a │ │ 2 │ bar │ b │ │ 3 │ baz │ c │ ╰───┴──────┴───────╯
Move multiple columns after the last column and reorder them.
> [[name value index]; [foo a 1] [bar b 2] [baz c 3]] | move value name --after index ╭───┬───────┬──────╮ │ # │ value │ name │ ├───┼───────┼──────┤ │ 1 │ a │ foo │ │ 2 │ b │ bar │ │ 3 │ c │ baz │ ╰───┴───────┴──────╯
Move columns of a record.
> { name: foo, value: a, index: 1 } | move name --before index
╭───────┬─────╮
│ value │ a │
│ name │ foo │
│ index │ 1 │
╰───────┴─────╯
Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/move.html