mirror of
https://github.com/nushell/nushell.git
synced 2024-12-02 13:24:30 +01:00
24 lines
389 B
Markdown
24 lines
389 B
Markdown
---
|
|
title: each group
|
|
layout: command
|
|
version: 0.59.1
|
|
---
|
|
|
|
Runs a block on groups of `group_size` rows of a table at a time.
|
|
|
|
## Signature
|
|
|
|
```> each group (group_size) (block)```
|
|
|
|
## Parameters
|
|
|
|
- `group_size`: the size of each group
|
|
- `block`: the block to run on each group
|
|
|
|
## Examples
|
|
|
|
Echo the sum of each pair
|
|
```shell
|
|
> echo [1 2 3 4] | each group 2 { |it| $it.0 + $it.1 }
|
|
```
|