wrap

For filters.

Wrap the value into a column.

Command Type

built-in

Signature

> wrap {flags} (name)

Parameters

  • name: The name of the column.

Input/output types:

input output
list<any> table
range table
any record

Examples

Wrap a list into a table with a given column name.

> [ Pachisi Mahjong Catan Carcassonne ] | wrap game
╭───┬─────────────╮
│ # │    game     │
├───┼─────────────┤
│ 0 │ Pachisi     │
│ 1 │ Mahjong     │
│ 2 │ Catan       │
│ 3 │ Carcassonne │
╰───┴─────────────╯

Wrap a range into a table with a given column name.

> 4..6 | wrap num
╭───┬─────╮
│ # │ num │
├───┼─────┤
│ 0 │   4 │
│ 1 │   5 │
│ 2 │   6 │
╰───┴─────╯

Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.