nushell/docs/commands/group-by.md

28 lines
389 B
Markdown
Raw Normal View History

---
title: group-by
layout: command
version: 0.59.1
---
2019-11-16 15:31:28 +01:00
Create a new table grouped.
2019-11-16 15:31:28 +01:00
## Signature
2019-11-16 15:31:28 +01:00
```> group-by (grouper)```
2019-11-16 15:31:28 +01:00
## Parameters
2019-11-16 15:31:28 +01:00
- `grouper`: the grouper value to use
2019-11-16 15:31:28 +01:00
## Examples
2019-11-16 15:31:28 +01:00
group items by column named "type"
2019-11-16 15:31:28 +01:00
```shell
> ls | group-by type
2019-11-16 15:31:28 +01:00
```
you can also group by raw values by leaving out the argument
2019-11-16 15:31:28 +01:00
```shell
> echo ['1' '3' '1' '3' '2' '1' '1'] | group-by
2019-11-16 15:31:28 +01:00
```