W3cubDocs

/Nushell

group for filters

Groups input into groups of `group_size`.

Signature

> group {flags} (group_size)

Parameters

  • group_size: the size of each group

Input/output types:

input output
list<any> list<list<any>>

Examples

Group the a list by pairs

> [1234] |group2
╭───┬───────────╮
0╭───┬───╮
01
12
╰───┴───╯
1╭───┬───╮
03
14
╰───┴───╯
╰───┴───────────╯

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