append
for filters> append {flags} (row)
row
: the row, list, or table to appendinput | output |
---|---|
any | list<any> |
Append one integer to a list
> [0123] |append4
╭───┬───╮
│0│0│
│1│1│
│2│2│
│3│3│
│4│4│
╰───┴───╯
Append a list to an item
>0|append [123]
╭───┬───╮
│0│0│
│1│1│
│2│2│
│3│3│
╰───┴───╯
Append a list of string to a string
>"a"|append ["b"]
╭───┬───╮
│0│a│
│1│b│
╰───┴───╯
Append three integer items
> [01] |append [234]
╭───┬───╮
│0│0│
│1│1│
│2│2│
│3│3│
│4│4│
╰───┴───╯
Append integers and strings
> [01] |append [2nu4shell]
╭───┬───────╮
│0│0│
│1│1│
│2│2│
│3│nu│
│4│4│
│5│shell│
╰───┴───────╯
Append a range of integers to a list
> [01] |append2..4
╭───┬───╮
│0│0│
│1│1│
│2│2│
│3│3│
│4│4│
╰───┴───╯
Be aware that this command 'unwraps' lists passed to it. So, if you pass a variable to it, and you want the variable's contents to be appended without being unwrapped, it's wise to pre-emptively wrap the variable in a list, like so: append [$val]
. This way, append
will only unwrap the outer list, and leave the variable's contents untouched.
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/append.html