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.tar.gz (26.1 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-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rpl-1.18.tar.gz
Algorithm Hash digest
SHA256 378d38de283f6682f85e93695396f3461d719778e17a8013f64bd87d7f671d7e
MD5 c7c8bdd44d5e8a4702003d91b6980382
BLAKE2b-256 f08581cd913d43251f923a56b44586c717f41e8ff5e4ea35d2ced60e9de00bbd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rpl-1.18-py3-none-any.whl
Algorithm Hash digest
SHA256 12b533b740aa41a99c99caf0a4367a4f1f9ae0711358b3e9a258758ed49fa0d3
MD5 cda7271c942b16f7b1bb163bc3ef999f
BLAKE2b-256 fe6d22a9a63dbe9bd016f15b5ff4e94cfaf0e7234265bcdfcdb2507146ed0a51

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