W3cubDocs

/Nushell

zip for filters

Combine a stream with the input.

Signature

> zip {flags} (other)

Parameters

  • other: the other input

Input/output types:

input output
list<any> list<list<any>>
range list<list<any>>

Examples

Zip two lists

> [12] |zip [34]
╭───┬───────────╮
0╭───┬───╮
01
13
╰───┴───╯
1╭───┬───╮
02
14
╰───┴───╯
╰───┴───────────╯

Zip two ranges

>1..3|zip4..6
╭───┬───────────╮
0╭───┬───╮
01
14
╰───┴───╯
1╭───┬───╮
02
15
╰───┴───╯
2╭───┬───╮
03
16
╰───┴───╯
╰───┴───────────╯

Rename .ogg files to match an existing list of filenames

>glob*.ogg|zip ['bang.ogg', 'fanfare.ogg', 'laser.ogg'] |each {|| mv$in.0$in.1 }

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