2020-05-03 18:54:21 +02:00
|
|
|
# wrap
|
|
|
|
|
|
|
|
Wraps data in a table
|
|
|
|
|
|
|
|
Syntax: `wrap <column>`
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
- `column`: the (optional) name of the column the data should be stored in.
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
`wrap` will give a name to a column of `<value>` data:
|
|
|
|
|
|
|
|
```shell
|
2020-06-23 20:21:47 +02:00
|
|
|
> ls | get name
|
2020-05-03 18:54:21 +02:00
|
|
|
───┬──────────────
|
2020-06-23 20:21:47 +02:00
|
|
|
# │
|
2020-05-03 18:54:21 +02:00
|
|
|
───┼──────────────
|
|
|
|
0 │ americas.csv
|
|
|
|
1 │ iso.csv
|
|
|
|
───┴──────────────
|
2020-06-23 20:21:47 +02:00
|
|
|
```
|
2020-05-03 18:54:21 +02:00
|
|
|
|
2020-06-23 20:21:47 +02:00
|
|
|
```shell
|
|
|
|
> ls | get name | wrap filename
|
2020-05-03 18:54:21 +02:00
|
|
|
───┬──────────────
|
|
|
|
# │ filename
|
|
|
|
───┼──────────────
|
|
|
|
0 │ americas.csv
|
|
|
|
1 │ iso.csv
|
|
|
|
───┴──────────────
|
|
|
|
```
|
|
|
|
|
2020-06-23 20:21:47 +02:00
|
|
|
`wrap` will encapsulate rows as embedded tables:
|
2020-05-03 18:54:21 +02:00
|
|
|
|
|
|
|
```shell
|
2020-06-23 20:21:47 +02:00
|
|
|
> ls | select name type size
|
2020-05-03 18:54:21 +02:00
|
|
|
───┬──────────────┬──────┬─────────
|
|
|
|
# │ name │ type │ size
|
|
|
|
───┼──────────────┼──────┼─────────
|
|
|
|
0 │ americas.csv │ File │ 317 B
|
|
|
|
1 │ iso.csv │ File │ 20.8 KB
|
|
|
|
───┴──────────────┴──────┴─────────
|
|
|
|
|
2020-06-23 20:21:47 +02:00
|
|
|
> ls | select name type size | each {wrap details}
|
2020-05-03 18:54:21 +02:00
|
|
|
───┬────────────────
|
|
|
|
# │ details
|
|
|
|
───┼────────────────
|
|
|
|
0 │ [table 1 rows]
|
|
|
|
1 │ [table 1 rows]
|
|
|
|
───┴────────────────
|
|
|
|
```
|
|
|
|
|
2020-06-23 20:21:47 +02:00
|
|
|
`wrap` will encapsulate a whole table as an embedded table:
|
2020-05-03 18:54:21 +02:00
|
|
|
|
|
|
|
```shell
|
2020-06-23 20:21:47 +02:00
|
|
|
> ls | wrap files
|
2020-05-03 18:54:21 +02:00
|
|
|
───────┬────────────────
|
|
|
|
files │ [table 2 rows]
|
|
|
|
───────┴────────────────
|
|
|
|
```
|