W3cubDocs

/Nushell

dfr replace for dataframe

Replace the leftmost (sub)string by a regex pattern.

Signature

> dfr replace {flags}

Flags

  • --pattern, -p {string}: Regex pattern to be matched
  • --replace, -r {string}: replacing string

Input/output types:

input output
any any

Examples

Replaces string

> [abcabcabc] |dfr into-df|dfr replace-pab-rAB
╭───┬─────╮
# │  0  │
├───┼─────┤
0ABc
1ABc
2ABc
╰───┴─────╯

Tips: Dataframe commands were not shipped in the official binaries by default, you have to build it with --features=dataframe flag

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