merge
for filters> merge {flags} (value)
value
: the new value to merge withinput | output |
---|---|
record | record |
table | table |
Add an 'index' column to the input table
> [abc] |wrapname|merge ( [123] |wrapindex )
╭───┬──────╮
│# │ name │
├───┼──────┤
│1│a│
│2│b│
│3│c│
╰───┴──────╯
Merge two records
> {a:1, b:2} |merge {c:3}
╭───┬───╮
│a│1│
│b│2│
│c│3│
╰───┴───╯
Merge two tables, overwriting overlapping columns
> [{columnA:A0columnB:B0}] |merge [{columnA:'A0*'}]
╭───┬─────────┬─────────╮
│# │ columnA │ columnB │
├───┼─────────┼─────────┤
│0│A0*│B0│
╰───┴─────────┴─────────╯
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.
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/merge.html