Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Recursively find and replace in file names and contents.

Project description

usage: pyreplace [-h] [-d DIRECTORY] [-r] [-v] [-g EXPRESSION]
[-f FIND REPLACE] [-fi] [-c FIND REPLACE] [-ci]

Recursively find and replace in file names and contents.

optional arguments:
-h, --help show this help message and exit
-d DIRECTORY, --directory DIRECTORY
Set starting directory.
-r, --dry-run Dont make any changes, just list what would happen.
-v, --verbose Display changes made.
-g EXPRESSION, --glob EXPRESSION
Find files with matching extension. Example: *.txt
-f FIND REPLACE, --filename FIND REPLACE
Search filename for FIND and replace with REPLACE.
-fi, --filename-insensitive
Ignore capital/lowercase when searching filename.
-c FIND REPLACE, --contents FIND REPLACE
Search contents for FIND and replace with REPLACE.
-ci, --contents-insensitive
Ignore capital/lowercase when searching contents.

Usage Examples:
Replace foo with bar in filenames matching *.txt:
pyreplace -g *.txt -f foo bar

Find and replace foo with bar in files matching *.txt (Contents):
pyreplace -g *.txt -c foo bar

As above with all files in current directory:
pyreplace -c foo bar

As above with all files in another directory:
pyreplace -d /home/foo -c foo bar

Project details


Release history Release notifications

This version
History Node

1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pyreplace-1.0-py3.2.egg (5.2 kB) Copy SHA256 hash SHA256 Egg 3.2 Aug 25, 2011

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page