W3cubDocs

/Nushell

move for filters

Move columns before or after other columns.

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

Parameters

  • ...rest: the columns to move

Input/output types:

input output
record record
table table

Examples

Move a column before the first column

> [[namevalueindex]; [fooa1] [barb2] [bazc3]] |moveindex--beforename
╭───┬──────┬───────╮
# │ name │ value │
├───┼──────┼───────┤
1fooa
2barb
3bazc
╰───┴──────┴───────╯

Move multiple columns after the last column and reorder them

> [[namevalueindex]; [fooa1] [barb2] [bazc3]] |movevaluename--afterindex
╭───┬───────┬──────╮
# │ value │ name │
├───┼───────┼──────┤
1afoo
2bbar
3cbaz
╰───┴───────┴──────╯

Move columns of a record

> { name:foo, value:a, index:1 } |movename--beforeindex
╭───────┬─────╮
valuea
namefoo
index1
╰───────┴─────╯

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/move.html