1. getoffmalawn
  2. renamer

Overview

HTTPS SSH

renamer

General

renamer is a batch file renamer. I couldn't find any decent console versions, so here we are.

Dependencies

Python 2.7, Python 3.x with minimal work.

Installation

Copy to a bin folder of your choice, and ensure it's executable. Personally, I make a symbolic link from ~/.bin/

Usage

renamer --help should give you enough to get you started, however, here's some examples...

Rename all mp4s to match "The Pacific S01E(episode).mp4":

renamer "The Pacific S01E{num}" 1 *mp4

Starting from another number

renamer "The Pacific S01E{num}" 5 *mp4

Other options:

--confirm, -c  Confirm files each file before renaming.
--dryrun, -d   Perform a dry run - don't change any actual files

You don't need to specify file extensions - renamer handles that for you.

Changes

April 22, 2012: Version 1.1

  • Rewrote module to not be such terrible code.
  • Now uses argparse.
  • Optional arguments are now specified in a more typical fashion, e.g. --dryrun and --confirm.