W3cubDocs

/Nushell

append for filters

Append any number of rows to a table.

Signature

> append {flags} (row)

Parameters

  • row: the row, list, or table to append

Input/output types:

input output
any list<any>

Examples

Append one integer to a list

> [0123] |append4
╭───┬───╮
00
11
22
33
44
╰───┴───╯

Append a list to an item

>0|append [123]
╭───┬───╮
00
11
22
33
╰───┴───╯

Append a list of string to a string

>"a"|append ["b"]
╭───┬───╮
0a
1b
╰───┴───╯

Append three integer items

> [01] |append [234]
╭───┬───╮
00
11
22
33
44
╰───┴───╯

Append integers and strings

> [01] |append [2nu4shell]
╭───┬───────╮
00
11
22
3nu
44
5shell
╰───┴───────╯

Append a range of integers to a list

> [01] |append2..4
╭───┬───╮
00
11
22
33
44
╰───┴───╯

Notes

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