SerieRenamer 1.0  

This program was created to help mass renaming of related files, like series or anime.

You add a serie of files, create masking patterns, set the result format and press the rename button, it's done.

Internally the program uses regexp to do the match, but a much easier matching language was created so anyone can use it without knowing anything about programming.

Full Delphi source code is provided as public domain, do anything you want with it.


Rangel Reale (hitnrun AT sf)

RegExp matching rules by Andrey V. Sorokin ( I included the regexp source code as a convenience, with the author's consent. Be sure to always get the latest version from his site.

  Matching rules (patterns)  

Patterns are just a list of tags and fixed text. The fixed text is used to mark where the tag is located.


Memories Off OVA - 01 - Endless Rain - [Anime-Keep].avi

On this file list, we have the following fields: group, title, episode number and extension.

A matching rule for the 01 ep would be:

%T - %N - %U - [%G].%E

Creating the fields: %T=title; %N=ep number; %U=undefined (don't care); %G=group; %E=extension

Note that the field names are NOT fixed, you can use any letter or number after the % character. You just have to name consistently between patterns, so you can make a result format that can find the correct fields in all filenames.

File for episode 3 is a problem, because it does't have a clear separation of the number and the title part. Do match it, we create the title tag more than one time, in the result name all tags with the same name will be added together with a space separating them.


The first %T would match "Memories", the next "Off", the next "OVA", and the %N would match the episode number.

The last one is easy, as there is a clear separator for the episode.


Now, note that the second rule ALSO matched the episode 2 file. That's because as episode 3 have no clear separator for the number but episode 2 has, the %N of episode 2 was matched as "-_2".
To solve this problem, you must know another rule:

- The patterns are applied from top to bottom, and the first matching pattern is selected.

So just move the third pattern up on the pattern list, and it will match the 2nd episode but not the 3rd, which will be matched by it's own rule.

  Result format  

The result format pattern is similar to the pattern format, with the differences that it's tags must be closed by another '%', and it can specify formatting options. The formatting options are listed on the result format dialog.

Let's say we want all files to be named like this:
<Title> - <Number with 2 digits> - [<Group name>].<file extension>

The result format would be:

%Tr% - %Nn2% - [%Gl%].%E%

First, the field 'T', with the 'r' formatting, that means (replace all '_' with spaces).
Next, the field 'N', using numeric alignment (add zeroes to the left instead of spaces to the right) and a minimum lenght of 2, the 'G' field lowercased (so all group names stay equal), and finally the 'E' field.

Using this format the file names would become:

Memories Off OVA - 01 - [anime-keep].avi
Memories Off OVA - 03 - [anime-keep].avi
Memories Off OVA - 02 - [anime-keep].avi

Note that in the result format, you don't NEED to use all fields, you can put fixed text anywhere you want. Let's say that you want the title to be only "Memories Off" for all the files, the result format would be:

Memories Off - %Nn2% - [%Gl%].%E%

That would ignore the 'T' field altogether, but do the job you want.

After all this, just press "EXECUTE RENAME OPERATION", and the files are renamed! A confirmation screen appears listing what was done and if it was successful, and the program closes.

  Download Logo