roll left for filters

Roll record or table columns left.

Signature

> roll left --by --cells-only

Parameters

  • --by {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 │
├───┼───┼───┼───┤
│ 0231 │
│ 1564 │
╰───┴───┴───┴───╯

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 │
├───┼───┼───┼───┤
│ 0231 │
│ 1564 │
╰───┴───┴───┴───╯

Tips: Command roll left was not included in the official binaries by default, you have to build it with --features=extra flag