A simple Perl script to sanitize and rename files by removing or replacing unwanted characters (spaces, commas, plus signs, apostrophes, etc.) and optionally changing dots to underscores except for the file extension.
- Batch file renaming for files under a specified directory (recursively).
- Single-file renaming if a direct path to a file is provided.
- Flexible replacement character: replace whitespace and other undesirable
characters with a custom character (
_
by default). - Optional file extension filter: only rename files matching a given extension
(e.g.,
pdf
,txt
, etc.). - Safety check: skips renaming if the file is already sanitized.
- Perl 5.10+ (or equivalent version that supports the modules used).
- Path::Tiny Perl module.
- (Optionally) App::cpanminus (cpanm) to install dependencies automatically.
- Clone this repository or download the files (
renamer
,Makefile
, andextract_modules.sh
). - Open a terminal in the directory where these files reside.
- Run:
make install