W3cubDocs

/Nushell

enumerate for filters

Enumerate the elements in a stream.

Signature

> enumerate {flags}

Input/output types:

input output
any table

Examples

Add an index to each element of a list

> [a, b, c] |enumerate
╭───┬──────╮
# │ item │
├───┼──────┤
0a
1b
2c
╰───┴──────╯

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