Curby's Batch File Mover/Renamer by Michael Lee v1.0, 2006-09-03 Introduction Rename files and directories with regular expressions. Installation 1. Place this script somewhere in your executable PATH. 2. Make sure that python is installed (this was tested with python 2.4). Usage By default, all options are off. Specifying an option enables its associated feature. Display Options: -h, --help Display this help text and exit -t, --test Display planned changes without performing them -v, --verbose Display every name change as it is made (use twice to see debugging output) Selection Options: -d, --directories Rename directories as well as files -r, --recursive Recursively process files in subdirectories Conflict Resolution Options: If a destination already exists, an error is reported and the program exits. This behavior can be modified as follows: -i, --interactive Prompt to force deletion on changes -f, --force Attempt to force changes without confirmation (this option overrides the -i option) PATTERNS must be compatible with python's re.sub() function. In general, Perl-compatible regular expressions will work. Examples mxv "y([0-9])\." "y0\1." Changes: curby2.txt To: curby02.txt curby20.txt curby20.txt (no change) mvx "^" "curby_" Changes: 2.txt To: curby_2.txt 3.txt curby_3.txt mvx ".jpg$" ".jpeg" Changes: curby.jpg To: curby.jpeg curby.jpg.txt curby.jpg.txt (no change) Exit status 0 Successful execution 1 Incorrect number of arguments 2 Unrecognized option detected by getopt 3 Unrecognized or extra argument 4 Destination exists, refusing to delete 5 Destination exists, cannot delete