Auto-generate markdown command docs (#4451)

* Finish updating

* a couple improvements

* Update renames

* cleanup examples
This commit is contained in:
JT
2022-02-13 21:22:51 -05:00
committed by GitHub
parent 06f5affc0b
commit 8c0a2d3c15
478 changed files with 7676 additions and 8045 deletions

View File

@ -1,50 +1,46 @@
# uniq
---
title: uniq
layout: command
version: 0.59.0
---
Returns unique rows or values from a dataset.
Return the unique rows.
## Signature
```> uniq --count --repeated --ignore-case --unique```
## Parameters
- `--count`: Count the unique rows
- `--repeated`: Count the rows that has more than one value
- `--ignore-case`: Ignore differences in case when comparing
- `--unique`: Only return unique values
## Examples
Given a file `test.csv`
```csv
first_name,last_name,rusty_at,type
Andrés,Robalino,10/11/2013,A
Andrés,Robalino,10/11/2013,A
Jonathan,Turner,10/12/2013,B
Yehuda,Katz,10/11/2013,A
```
Remove duplicate rows of a list/table
```shell
> `open test.csv | uniq`
━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━
# │ first_name │ last_name │ rusty_at │ type
───┼────────────┼───────────┼────────────┼──────
0 │ Andrés │ Robalino │ 10/11/2013 │ A
1 │ Jonathan │ Turner │ 10/12/2013 │ B
2 │ Yehuda │ Katz │ 10/11/2013 │ A
━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━
> [2 3 3 4] | uniq
```
Only print duplicate lines, one for each group
```shell
> `open test.csv | get type | uniq`
━━━┯━━━━━━━━━
# │
───┼─────────
0 │ A
1 │ B
━━━┷━━━━━━━━━
> [1 2 2] | uniq -d
```
### Counting
`--count` or `-c` is the flag to output a `count` column.
Only print unique lines lines
```shell
> `open test.csv | get type | uniq -c`
───┬───────┬───────
# │ value │ count
───┼───────┼───────
0 │ A │ 3
1 │ B │ 2
───┴───────┴───────
> [1 2 2] | uniq -u
```
Ignore differences in case when comparing
```shell
> ['hello' 'goodbye' 'Hello'] | uniq -i
```
Remove duplicate rows and show counts of a list/table
```shell
> [1 2 2] | uniq -c
```