2019-11-15 15:37:41 +01:00
|
|
|
# append
|
2020-06-23 20:21:47 +02:00
|
|
|
|
2019-11-15 15:37:41 +01:00
|
|
|
This command allows you to append the given row to the table.
|
|
|
|
|
2020-03-13 18:23:41 +01:00
|
|
|
**Note**:
|
2020-06-23 20:21:47 +02:00
|
|
|
|
2019-11-15 15:37:41 +01:00
|
|
|
- `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
|
2020-06-23 20:21:47 +02:00
|
|
|
───┬────────────
|
|
|
|
# │
|
2019-11-15 15:37:41 +01:00
|
|
|
───┼────────────
|
|
|
|
0 │ Canberra
|
|
|
|
1 │ London
|
|
|
|
2 │ Nairobi
|
|
|
|
3 │ Washington
|
2020-06-23 20:21:47 +02:00
|
|
|
───┴────────────
|
2019-11-15 15:37:41 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
You can add a new row by using `append`:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
> open cities.txt | lines | append Beijing
|
2020-06-23 20:21:47 +02:00
|
|
|
───┬────────────
|
|
|
|
# │
|
2019-11-15 15:37:41 +01:00
|
|
|
───┼────────────
|
|
|
|
0 │ Canberra
|
|
|
|
1 │ London
|
|
|
|
2 │ Nairobi
|
|
|
|
3 │ Washington
|
|
|
|
4 │ Beijing
|
2020-06-23 20:21:47 +02:00
|
|
|
───┴────────────
|
2019-11-15 15:37:41 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
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"
|
2020-06-23 20:21:47 +02:00
|
|
|
───┬──────────────
|
|
|
|
# │
|
2019-11-15 15:37:41 +01:00
|
|
|
───┼──────────────
|
|
|
|
0 │ Canberra
|
|
|
|
1 │ London
|
|
|
|
2 │ Nairobi
|
|
|
|
3 │ Washington
|
|
|
|
4 │ Beijing
|
|
|
|
5 │ Buenos Aires
|
2020-06-23 20:21:47 +02:00
|
|
|
───┴──────────────
|
2019-11-15 15:37:41 +01:00
|
|
|
```
|