From d7d487de73ef5a2381a24666c2ce3b46e93b2658 Mon Sep 17 00:00:00 2001 From: chrisr Date: Sun, 3 May 2020 17:54:21 +0100 Subject: [PATCH] Basic documentation for the wrap command (#1704) --- docs/commands/wrap.md | 61 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 docs/commands/wrap.md diff --git a/docs/commands/wrap.md b/docs/commands/wrap.md new file mode 100644 index 0000000000..f6d907a2c0 --- /dev/null +++ b/docs/commands/wrap.md @@ -0,0 +1,61 @@ +# wrap + +Wraps data in a table + +Syntax: `wrap ` + +## Parameters + +- `column`: the (optional) name of the column the data should be stored in. + +## Examples + +`wrap` will give a name to a column of `` data: + +```shell +/home/chris> ls | get name +───┬────────────── + # │ +───┼────────────── + 0 │ americas.csv + 1 │ iso.csv +───┴────────────── + +/home/chris> ls | get name | wrap filename +───┬────────────── + # │ filename +───┼────────────── + 0 │ americas.csv + 1 │ iso.csv +───┴────────────── +``` + +`wrap` will encapsulate rows as embedded tables : + +```shell +/home/chris> ls | pick name type size +───┬──────────────┬──────┬───────── + # │ name │ type │ size +───┼──────────────┼──────┼───────── + 0 │ americas.csv │ File │ 317 B + 1 │ iso.csv │ File │ 20.8 KB +───┴──────────────┴──────┴───────── + +/home/chris> ls | pick name type size | each {wrap details} +───┬──────────────── + # │ details +───┼──────────────── + 0 │ [table 1 rows] + 1 │ [table 1 rows] +───┴──────────────── +``` + +`wrap` will encapsulate a whole table as an embedded table : + +```shell +/home/chris> ls | wrap files +───────┬──────────────── + files │ [table 2 rows] +───────┴──────────────── +``` +