nushell/docs/commands/flatten.md
Fernando Herrera dbcadbc12c moved folders
2022-02-07 19:23:12 +00:00

640 B

flatten

Flatten the table.

Usage

> flatten ...args {flags} 

Parameters

  • ...args: optionally flatten data by column

Flags

  • -h, --help: Display this help message

Examples

  • flatten a table
> echo [[N, u, s, h, e, l, l]] | flatten | first
  • flatten a column having a nested table
> echo [[origin, people]; [Ecuador, (echo [[name, meal]; ['Andres', 'arepa']])]] | flatten | get meal

restrict the flattening by passing column names

> echo [[origin, crate, versions]; [World, (echo [[name]; ['nu-cli']]), ['0.21', '0.22']]] | flatten versions | last | get versions