https://github.com/kilo59/mass_replace
Walkthrough directories and perform find and replace on select filetypes.
https://github.com/kilo59/mass_replace
find-and-replace
Last synced: 6 months ago
JSON representation
Walkthrough directories and perform find and replace on select filetypes.
- Host: GitHub
- URL: https://github.com/kilo59/mass_replace
- Owner: Kilo59
- License: mit
- Created: 2018-04-18T23:23:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-02-04T00:54:45.000Z (8 months ago)
- Last Synced: 2025-04-10T16:50:27.639Z (6 months ago)
- Topics: find-and-replace
- Language: Python
- Homepage:
- Size: 72.3 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mass_replace
[](https://badge.fury.io/py/mass-replace) [](https://pypi.org/project/mass-replace/) [](https://travis-ci.org/Kilo59/mass_replace) [](https://coveralls.io/github/Kilo59/mass_replace?branch=master) [](https://github.com/ambv/black)
## Use case
`mass_replace` "Walkthrough" through a specified `root_folder` and perform find and replace operations on every file of the specified type.
* If `Python 3` is installed on your system it can be run as `mass_replace.py` Python script
* Can be run as a standalone Window Executable (`.exe`)--------------------------------------------
## ⚠️ **WARNING** ⚠️
EVERY FILE OF THE SPECIFIED TYPE NESTED UNDERNEATH THE `root_folder` WILL BE SUBJECT TO FIND AND REPLACE OPERATIONS------------------------------------------------
## Installation and usage
### Install with pip
```
pip install mass-replace
```### To run as a standalone `.exe`
1. Download `mass_replace_windows_executable.zip`
2. Extract zip file.
3. Set configuration settings
- from `mass_replace/` open `config.yaml` with any text editor.
- set `filetypes` to control which filetypes will be "operated on".
- set `replacement_paris` to control the find and replace operations to be performed on each file.
- set 'root_folder' to set the parent folder under which the operations will be performed.
4. Run `mass_replace.exe`
- Double click `mass_replace.exe`
- or run from command line/powershell ✔️```yaml
# mass_replace config file
root_folder: C:\Users\username\Documents\docs_go_here_folder
filetypes:
- csv
- xml
- txt
replacement_pairs:
old_text1: new_text1
old_text2: new_text2
puff_daddy: diddy
```### Ease of Use suggestions
To make the use of `mass_replace.exe` easier.
Create shortcuts of `mass_replace.exe` and `config.yaml` and place them somewhere easy to get to.
Do not move the actual files or the application will not work.