Skip to main content

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 | RSS feed

This version

1.0

Download files

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

Built Distribution

pyreplace-1.0-py3.2.egg (5.2 kB view hashes)

Uploaded 3 2

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page