Skip to main content

Replace strings in files

Project description

rpl

https://github.com/rrthomas/rpl
© 2025 Reuben Thomas rrt@sc3d.org

A search/replace utility.

rpl replaces strings with new strings in multiple text files. See the man page rpl(1) for more information. Install rpl using pip install rpl.

rpl is distributed under the terms of the GNU General Public License; either version 3 of the License, or (at your option), any later version. See the file COPYING for more details.

See rpl --version for a full list of copyright holders.

usage: rpl [-h] [--version] [--encoding ENCODING] [-i] [-m] [-w] [-b] [-q]
           [-v] [-s] [-e] [-F] [--files] [-x GLOB] [-R] [-p] [-f] [-d]
           OLD-TEXT NEW-TEXT [FILE ...]

Search and replace text in files.

positional arguments:
  OLD-TEXT
  NEW-TEXT
  FILE                  `-' or no FILE argument means standard input

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --encoding ENCODING   specify character set encoding
  -i, --ignore-case     search case-insensitively
  -m, --match-case      ignore case when searching, but try to match case of
                        replacement to case of original, either capitalized,
                        all upper-case, or mixed
  -w, --whole-words     whole words (OLD-TEXT matches on word boundaries only)
  -b, --backup          rename original FILE to FILE~ before replacing
  -q, --quiet           quiet mode
  -v, --verbose         verbose mode
  -s, --dry-run         simulation mode
  -e, --escape          expand escapes in OLD-TEXT and NEW-TEXT [deprecated]
  -F, --fixed-strings   treat OLD-TEXT and NEW-TEXT as fixed strings, not
                        regular expressions
  --files               OLD-TEXT and NEW-TEXT are file names to read patterns
                        from
  -x GLOB, --glob GLOB  modify only files matching the given glob (may be
                        given more than once)
  -R, --recursive       search recursively
  -p, --prompt          prompt before modifying each file
  -f, --force           ignore errors when trying to preserve attributes
  -d, --keep-times      keep the modification times on modified files

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpl-1.18.1.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rpl-1.18.1-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file rpl-1.18.1.tar.gz.

File metadata

  • Download URL: rpl-1.18.1.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for rpl-1.18.1.tar.gz
Algorithm Hash digest
SHA256 16bd0132ff9032155a1cc83e5ddee93dee3fb301f47410030012a06d2223502a
MD5 e563c5d09911ed0799d9efdf5ff160d9
BLAKE2b-256 7f1a08162aacb4a35850a9558b0bf3c8fb68f927a0967b7f1a7fc960ea85d8d2

See more details on using hashes here.

File details

Details for the file rpl-1.18.1-py3-none-any.whl.

File metadata

  • Download URL: rpl-1.18.1-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for rpl-1.18.1-py3-none-any.whl
Algorithm Hash digest
SHA256 850ddedc3c55dfe3114eb3c70f8b92dfc6c945b294f45edf461d437521ec6150
MD5 7dd2a5f90ce38636736638722db9d8d8
BLAKE2b-256 98eddf42562caf2f1b9a970e0c75d98b5e8d3168323fb54d7bdf78b2d99de11f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page