Spec-Zone.ru › Nushell

bytes remove for bytes

Remove specified bytes from the input.

Signature

> bytes remove {flags} (pattern) ...rest

Flags

  • --end, -e: Remove from end of binary.
  • --all, -a: Remove occurrences of finding binary.

Parameters

  • pattern: The pattern to find.
  • ...rest: For a data structure input, remove bytes from data at the given cell paths.

Input/output types:

input output
binary binary
table table
record record

Examples

Remove contents.

> 0x[10 AA FF AA FF] | bytes remove 0x[10 AA]
Length: 3 (0x3) bytes | null_char printable whitespace ascii_other non_ascii
00000000:   ff aa ff                                             ×××

Remove all occurrences of find binary in record field.

> { data: 0x[10 AA 10 BB 10] } | bytes remove --all 0x[10] data
╭──────┬────────────╮
│ data │ [170, 187] │
╰──────┴────────────╯

Remove occurrences of find binary from end.

> 0x[10 AA 10 BB CC AA 10] | bytes remove --end 0x[10]
Length: 6 (0x6) bytes | null_char printable whitespace ascii_other non_ascii
00000000:   10 aa 10 bb  cc aa                                   •ו×××

Remove find binary from end not found.

> 0x[10 AA 10 BB CC AA 10] | bytes remove --end 0x[11]
Length: 7 (0x7) bytes | null_char printable whitespace ascii_other non_ascii
00000000:   10 aa 10 bb  cc aa 10                                •ו××ו

Remove all occurrences of find binary in table.

> [[ColA ColB ColC]; [0x[11 12 13] 0x[14 15 16] 0x[17 18 19]]] | bytes remove 0x[11] ColA ColC
╭───┬──────────┬──────────────┬──────────────╮
│ # │   ColA   │     ColB     │     ColC     │
├───┼──────────┼──────────────┼──────────────┤
│ 0 │ [18, 19] │ [20, 21, 22] │ [23, 24, 25] │
╰───┴──────────┴──────────────┴──────────────╯

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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API