Spec-Zone.ru › Nushell

merge for filters

Merge the input with a record or table, overwriting values in matching columns.

Signature

> merge {flags} (value)

Parameters

  • value: The new value to merge with.

Input/output types:

input output
record record
table table

Examples

Add an 'id' column to the input table.

> [a b c] | wrap name | merge ( [47 512 618] | wrap id )
╭───┬──────┬─────╮
│ # │ name │ id  │
├───┼──────┼─────┤
│ 0 │ a    │  47 │
│ 1 │ b    │ 512 │
│ 2 │ c    │ 618 │
╰───┴──────┴─────╯

Merge two records.

> {a: 1, b: 2} | merge {c: 3}
╭───┬───╮
│ a │ 1 │
│ b │ 2 │
│ c │ 3 │
╰───┴───╯

Merge two tables, overwriting overlapping columns.

> [{columnA: A0 columnB: B0}] | merge [{columnA: 'A0*'}]
╭───┬─────────┬─────────╮
│ # │ columnA │ columnB │
├───┼─────────┼─────────┤
│ 0 │ A0*     │ B0      │
╰───┴─────────┴─────────╯

Notes

You may provide a column structure to merge

When merging tables, row 0 of the input table is overwritten with values from row 0 of the provided table, then repeating this process with row 1, and so on.

Subcommands:

name description type
merge deep Merge the input with a record or table, recursively merging values in matching columns. built-in

Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/merge.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API