2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: compact
|
|
|
|
layout: command
|
|
|
|
version: 0.59.0
|
|
|
|
---
|
2019-12-01 17:39:17 +01:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
Creates a table with non-empty rows.
|
2019-12-01 17:39:17 +01:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
## Signature
|
2020-06-23 20:21:47 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
```> compact ...columns```
|
2019-12-01 17:39:17 +01:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
## Parameters
|
|
|
|
|
|
|
|
- `...columns`: the columns to compact from the table
|
2019-12-01 17:39:17 +01:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
## Examples
|
2019-12-01 17:39:17 +01:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
Filter out all records where 'Hello' is null (returns nothing)
|
2019-12-01 17:39:17 +01:00
|
|
|
```shell
|
2022-02-14 03:22:51 +01:00
|
|
|
> echo [["Hello" "World"]; [$nothing 3]]| compact Hello
|
2019-12-01 17:39:17 +01:00
|
|
|
```
|
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
Filter out all records where 'World' is null (Returns the table)
|
|
|
|
```shell
|
|
|
|
> echo [["Hello" "World"]; [$nothing 3]]| compact World
|
|
|
|
```
|
2019-12-01 17:39:17 +01:00
|
|
|
|
2022-02-25 14:14:15 +01:00
|
|
|
Filter out all instances of nothing from a list (Returns [1,2])
|
2019-12-01 17:39:17 +01:00
|
|
|
```shell
|
2022-02-14 03:22:51 +01:00
|
|
|
> echo [1, $nothing, 2] | compact
|
2019-12-01 17:39:17 +01:00
|
|
|
```
|