From 08b770719cf71e8ab8db5cca8f037a44b44b7e04 Mon Sep 17 00:00:00 2001 From: sebastian-xyz <52786998+sebastian-xyz@users.noreply.github.com> Date: Fri, 15 Nov 2019 15:37:41 +0100 Subject: [PATCH] Add append command documentation --- docs/commands/append.md | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 docs/commands/append.md diff --git a/docs/commands/append.md b/docs/commands/append.md new file mode 100644 index 0000000000..8bb2cabee3 --- /dev/null +++ b/docs/commands/append.md @@ -0,0 +1,53 @@ +# append +This command allows you to append the given row to the table. + +**Note**: +- `append` does not change a file itself. If you want to save your changes, you need to run the `save` command +- if you want to add something containing a whitespace character, you need to put it in quotation marks + +## Examples + +Let's add more cities to this table: + +```shell +> open cities.txt | lines +━━━┯━━━━━━━━━━━━ + # │ +───┼──────────── + 0 │ Canberra + 1 │ London + 2 │ Nairobi + 3 │ Washington +━━━┷━━━━━━━━━━━━ +``` + +You can add a new row by using `append`: + +```shell +> open cities.txt | lines | append Beijing +━━━┯━━━━━━━━━━━━ + # │ +───┼──────────── + 0 │ Canberra + 1 │ London + 2 │ Nairobi + 3 │ Washington + 4 │ Beijing +━━━┷━━━━━━━━━━━━ +``` + +It's not possible to add multiple rows at once, so you'll need to call `append` multiple times: + +```shell +> open cities.txt | lines | append Beijing | append "Buenos Aires" +━━━┯━━━━━━━━━━━━━━ + # │ +───┼────────────── + 0 │ Canberra + 1 │ London + 2 │ Nairobi + 3 │ Washington + 4 │ Beijing + 5 │ Buenos Aires +━━━┷━━━━━━━━━━━━━━ +```