Home Explore Blog CI



nushell

commands/docs/append.md
f21ea10e556fa8a4246ec8b23168f38e4b538f9dae3cee7000000003000008a6
---
title: append
categories: |
  filters
version: 0.104.0
filters: |
  Append any number of rows to a table.
usage: |
  Append any number of rows to a table.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `append` for [filters](/commands/categories/filters.md)

<div class='command-title'>Append any number of rows to a table.</div>

## Signature

```> append {flags} (row)```

## Parameters

 -  `row`: The row, list, or table to append.


## Input/output types:

| input | output    |
| ----- | --------- |
| any   | list\<any\> |
## Examples

Append one int to a list
```nu
> [0 1 2 3] | append 4
╭───┬───╮
│ 0 │ 0 │
│ 1 │ 1 │
│ 2 │ 2 │
│ 3 │ 3 │
│ 4 │ 4 │
╰───┴───╯

```

Append a list to an item
```nu
> 0 | append [1 2 3]
╭───┬───╮
│ 0 │ 0 │
│ 1 │ 1 │
│ 2 │ 2 │
│ 3 │ 3 │
╰───┴───╯

```

Append a list of string to a string
```nu
> "a" | append ["b"]
╭───┬───╮
│ 0 │ a │
│ 1 │ b │
╰───┴───╯

```

Append three int items
```nu
> [0 1] | append [2 3 4]
╭───┬───╮
│ 0 │ 0 │
│ 1 │ 1 │
│ 2 │ 2 │
│ 3 │ 3 │
│ 4 │ 4 │
╰───┴───╯

```

Append ints and strings
```nu
> [0 1] | append [2 nu 4 shell]
╭───┬───────╮
│ 0 │     0 │
│ 1 │     1 │
│ 2 │     2 │
│ 3 │ nu    │
│ 4 │     4 │
│ 5 │ shell │
╰───┴───────╯

```

Append a range of ints to a list
```nu
> [0 1] | append 2..4
╭───┬───╮
│ 0 │ 0 │
│ 1 │ 1 │
│ 2 │ 2 │
│ 3 │ 3 │
│ 4 │ 4 │
╰───┴───╯

```

## 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.

Chunks
973cec2d (1st chunk of `commands/docs/append.md`)
Title: append command in Nushell
Summary
The `append` command in Nushell allows you to add rows, lists, or tables to an existing table or list. It takes the input data and appends the provided row, list, or table to it, returning a new list with the appended data. The command unwraps lists passed to it, so to avoid unwrapping a variable's contents, wrap it in a list first.