mirror of
https://github.com/nushell/nushell.git
synced 2024-11-25 09:53:43 +01:00
5ca9e12b7f
* Remove EOL whitespace in files other than docs * Break paragraphs into lines See http://rhodesmill.org/brandon/2012/one-sentence-per-line/ for the rationale * Fix various typos * Remove EOL whitespace in docs/commands/*.md
35 lines
1.1 KiB
Markdown
35 lines
1.1 KiB
Markdown
# compact
|
|
|
|
This command allows us to filters out rows with empty columns. Other commands are capable of feeding `compact` with their output through pipelines.
|
|
|
|
## Usage
|
|
```shell
|
|
> [input-command] | compact [column-name]
|
|
```
|
|
|
|
## Examples
|
|
|
|
Let's say we have a table like this:
|
|
|
|
```shell
|
|
> open contacts.json
|
|
━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━
|
|
# │ name │ email
|
|
───┼──────────┼──────────────────
|
|
0 │ paul │ paul@example.com
|
|
1 │ andres │
|
|
2 │ jonathan │
|
|
━━━┷━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━
|
|
```
|
|
|
|
`compact` allows us to filter out rows with empty `email` column:
|
|
|
|
```shell
|
|
> open contacts.json | compact email
|
|
━━━━━━┯━━━━━━━━━━━━━━━━━━
|
|
name │ email
|
|
──────┼──────────────────
|
|
paul │ paul@example.com
|
|
━━━━━━┷━━━━━━━━━━━━━━━━━━
|
|
```
|