From ce23a672d994a069bb137de199c72e049cf41bb1 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Sun, 1 Dec 2019 17:39:17 +0100 Subject: [PATCH] add documentation for compact command --- docs/commands/compact.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 docs/commands/compact.md diff --git a/docs/commands/compact.md b/docs/commands/compact.md new file mode 100644 index 0000000000..8399942e11 --- /dev/null +++ b/docs/commands/compact.md @@ -0,0 +1,34 @@ +# 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 +━━━━━━┷━━━━━━━━━━━━━━━━━━ +```