Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

roll left for filters

Roll record or table columns left.

Signature

> roll left {flags}

Flags

  • --by, -b {int}: Number of columns to roll
  • --cells-only, -c: rotates columns leaving headers fixed

Input/output types:

inputoutput
recordrecord
tabletable

Examples

Rolls columns of a record to the left

> {a:1 b:2 c:3} | roll left
╭───┬───╮
│ b │ 2 │
│ c │ 3 │
│ a │ 1 │
╰───┴───╯

Rolls columns of a table to the left

> [[a b c]; [1 2 3] [4 5 6]] | roll left
╭───┬───┬───┬───╮
│ # │ b │ c │ a │
├───┼───┼───┼───┤
│ 0 │ 2 │ 3 │ 1 │
│ 1 │ 5 │ 6 │ 4 │
╰───┴───┴───┴───╯

Rolls columns to the left without changing column names

> [[a b c]; [1 2 3] [4 5 6]] | roll left --cells-only
╭───┬───┬───┬───╮
│ # │ a │ b │ c │
├───┼───┼───┼───┤
│ 0 │ 2 │ 3 │ 1 │
│ 1 │ 5 │ 6 │ 4 │
╰───┴───┴───┴───╯