roll right for filters

Roll table columns right.

Signature

> roll right --by --cells-only

Parameters

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

Examples

Rolls columns of a record to the right

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

Rolls columns to the right

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

Rolls columns to the right with fixed headers

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