W3cubDocs

/Nushell

headers for filters

Use the first row of the table as column names.

Signature

> headers {flags}

Input/output types:

input output
list<any> table
table table

Examples

Sets the column names for a table created by split column

>"a b c|1 2 3"|split row"|"|split column" "|headers
╭───┬───┬───┬───╮
# │ a │ b │ c │
├───┼───┼───┼───┤
0123
╰───┴───┴───┴───╯

Columns which don't have data in their first row are removed

>"a b c|1 2 3|1 2 3 4"|split row"|"|split column" "|headers
╭───┬───┬───┬───╮
# │ a │ b │ c │
├───┼───┼───┼───┤
0123
1123
╰───┴───┴───┴───╯

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