Split split command to sub commands.

This commit is contained in:
Andrés N. Robalino
2020-05-24 01:41:30 -05:00
parent 74c2daf665
commit edbecda14d
22 changed files with 154 additions and 57 deletions

View File

@ -5,7 +5,7 @@ Use `rename` to give columns more appropriate names.
## Examples
```shell
> open /etc/passwd | lines | split-column ":" | rename user password uid gid gecos home shell
> open /etc/passwd | lines | split column ":" | rename user password uid gid gecos home shell
────┬────────┬──────────┬──────┬──────┬────────┬─────────────────┬──────────────────
# │ user │ password │ uid │ gid │ gecos │ home │ shell
────┼────────┼──────────┼──────┼──────┼────────┼─────────────────┼──────────────────

View File

@ -1,8 +1,8 @@
# split-column
# split column
Split row contents across multiple columns via the separator.
splits contents across multiple columns via the separator.
Syntax: `split-column <separator> ...args{flags}`
Syntax: `split column <separator> ...args{flags}`
### Parameters
@ -31,10 +31,10 @@ If we have file structured like this:
1.0459770114942528 | 1.0925925925925926 | 0.6164383561643836
```
We can build a table from it using the `split-column` command
We can build a table from it using the `split column` command
```shell
> open coordinates.txt | lines | split-column " | "
> open coordinates.txt | lines | split column " | "
━━━┯━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━
# │ Column1 │ Column2 │ Column3
───┼─────────────────────┼──────────────────────┼────────────────────
@ -54,7 +54,7 @@ We can build a table from it using the `split-column` command
And give names to the columns
```shell
> open coordinates.txt | lines | split-column " | " x y z
> open coordinates.txt | lines | split column " | " x y z
━━━┯━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━
# │ x │ y │ z
───┼─────────────────────┼──────────────────────┼────────────────────

View File

@ -1,8 +1,8 @@
# split-row
# split row
Split row contents over multiple rows via the separator.
splits contents over multiple rows via the separator.
Syntax: `split-row <separator>`
Syntax: `split row <separator>`
### Parameters:
* `<separator>` the character that denotes what separates rows
@ -17,10 +17,10 @@ We can build a table from a file that looks like this
```
using the `split-row` command.
using the `split row` command.
```shell
open table.txt | split-row ", "
open table.txt | split row ", "
━━━┯━━━━━━━━━
# │ <value>
───┼─────────