bytes index-of
for bytes> bytes index-of {flags} (pattern) ...rest
--all, -a
: returns all matched index--end, -e
: search from the end of the binarypattern
: the pattern to find index of...rest
: for a data structure input, find the indexes at the given cell pathsinput | output |
---|---|
binary | int |
record | record |
table | table |
Returns index of pattern in bytes
>0x[3344551001134455] |bytes index-of0x[4455]
1
Returns index of pattern, search from end
>0x[3344551001134455] |bytes index-of-e0x[4455]
6
Returns all matched index
>0x[334455100133443344] |bytes index-of-a0x[3344]
╭───┬───╮
│0│0│
│1│5│
│2│7│
╰───┴───╯
Returns all matched index, searching from end
>0x[334455100133443344] |bytes index-of-a-e0x[3344]
╭───┬───╮
│0│7│
│1│5│
│2│0│
╰───┴───╯
Returns index of pattern for specific column
> [[ColAColBColC]; [0x[111213] 0x[141516] 0x[171819]]] |bytes index-of0x[11] ColAColC
╭───┬──────┬──────────────┬──────╮
│# │ ColA │ ColB │ ColC │
├───┼──────┼──────────────┼──────┤
│0│0│ [20, 21, 22] │-1│
╰───┴──────┴──────────────┴──────╯
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/bytes_index-of.html