2
0
Fork 0
mirror of https://github.com/nushell/nushell synced 2025-01-26 20:05:14 +00:00
nushell/docs/commands/compact.md
Justin Ma c0a1d18e3d
update , regenerate commands' docs and update make_docs script ()
* feat: update , regenerate commands' docs

* chore: update make_docs script
2022-02-21 11:26:00 -06:00

599 B

title layout version
compact command 0.59.0

Creates a table with non-empty rows.

Signature

> compact ...columns

Parameters

  • ...columns: the columns to compact from the table

Examples

Filter out all records where 'Hello' is null (returns nothing)

> echo [["Hello" "World"]; [$nothing 3]]| compact Hello

Filter out all records where 'World' is null (Returns the table)

> echo [["Hello" "World"]; [$nothing 3]]| compact World

Filter out all instances of nothing from a list (Returns [1,2]

> echo [1, $nothing, 2] | compact