FBI / TAMS / Applets / Regex Filename Changer (Webstart Download)
Run

(requires Java Webstart and JDK 1.3.1 or newer).

Note: the security mechanisms of Java Webstart require digitally signed program files. To avoid the very expensive fees of the well-known certification agencies, we use a simple self-signed digital signature. You have to agree to run the application despite the warning about the self-signed signature from Java Webstart.

Description
RegexFilenameChanger is a little tool to change filenames based on regular expressions. It applies the user-specified pattern(s) onto all files in the selected directory. For example, you might want to rename a set of MP3-files to the convention used by your own collection. Using RegexFilenameChanger can be a lot faster than renaming each individual file via the built-in tools of your operating system. It is less flexible than fancy Unix-shell scripts, but is easier to understand and requires no additional programming.

Here's how to do it:

  1. Click on the button above to download and start the RegexFilenameChanger program via the Java Webstart Installer.

  2. Once the program has started, you can use the Menu->Select directory to select the directory with the files you want to rename. The original names of the files in the selected directory appear in the left column of the main window.
  3. You can edit the filenames using the textfields in the right column. Standard editor function like cut/copy/paste and mouse selection should work.

  4. Use the textfield in the lower left to specify a regular expression that should be matched in the filenames. For example, _ matches a single underscore, while pattern matches the exact 7 character sequence, and a*b matches the longest sequence that begins with an 'a' and ends with a 'b'.
  5. Remember to quote control characters like '.' and '[' by preceeding them with a backslash; e.g. write '\. ' to match a full-stop character followed by a space character.
  6. Specify a replacement expression that should be used for each of the matched strings in the filenames. For example, enter the empty string to replace any occurance of the previously selected expression with nothing.
  7. Press the Apply pattern button to change all filenames using the selected expression and replacement strings. Use Undo to undo the last change.
  8. Repeat the above steps with a new expression and replacement, if necessary.

  9. Finally, use the Rename files button to actually rename the files from their original names (left column) to the currently selected new names (right column).

    (Note: due to a bug, you can use the Rename-button only once. If necessary, use Menu->Select directory again to reenable the rename button for a given directory.)

Examples: not yet. Just play with the tool.

Disclaimer
It should be obvious that renaming files is a potentially dangerous operation, especially when applied to important files of your operating system. If you rename files to bad names, it might be a lot of work to restore the original names. No warranty.
14.09.2004 Impressum
http://tams-www.informatik.uni-hamburg.de/applets/regex/index.html