Numbering of Files

There are several types of numbering files and folders: On the one hand, you can intentionally decide to number a series of files - for example the tracks of an audio album or the episodes of a series. On the other hand, automatic numbering may be necessary if more than one file or folder would otherwise get the same name, which would not be possible, since file names must be unique.

In this tutorial we look at both of these types of numbering and look at the possibilities and settings that the FileRenamer offers us in this context.

Numbering with the %num% Placeholder

If you want to intentionally number a series of files or folders, you can do this with the placeholder %num%. The placeholder %num% can be used in every text field of the FileRenamer (for example in the functions "Search and Replace", "Mask", "Append Text" or "Insert Text") and stands for a number that depends on the position of the file in the list. You can change the positions of the files in the list by sorting the files with clicking on a column header or with moving the files manually in the list.

In the menu of the FileRenamer under "Settings > Numbering" you can find some settings with which you can influence the %num% placeholder:

In the fields "Initial Value" as well as "Increment", not only integer values such as 1 or 2 can be used, but also decimal numbers or fractions such as 0.25 or 1/3. This makes it possible to give several files the same number. The internal incrementing of the numbers is done with decimal places, but when the numbers are set, the decimal places are cut off. As an example, with an initial value of 1.5 and an increment of 0.5, the file numbering would be 1 - 2 - 2 - 3 - 3 and so on, resulting from the internal count 1.5 - 2.0 - 2.5 - 3.0 - 3.5.

Using the following options, you can also reset or pause numbering increment based on specific criteria:

Other Placeholders for the Numbering

In addition to the %num% placeholder, the FileRenamer provides you with the following other placeholders for the numbering of files and folders:

In the overview over all placeholders of the FileRenamer, you can receive an overview of all other placeholders that you can use in the FileRenamer. In the section "Numbering" of this compilation, also the various %num% and %abs% placeholders are described.

Numbering of Same-Named Files

In addition to the intentional numbering by using the placeholder %num%, the FileRenamer can also lead to the situation that an automatic numbering of files or folders becomes necessary. Namely, if more than one files or folders would get the same name after applying the set changes and if those files or folders are additionally also stored in the same path. Since two files cannot have the same file path because file names have to be unique, the question arises in this case how the FileRenamer should deal with such a situation.

You can control this with the option "Number files for which the renaming would result in the same name", which you can find in the settings of the FileRenamer in the menu "Settings > Numbering > Same-Named Files".

Under this option, you will find a few more options with which you can control the numbering of the same named files, which of course are only used if the option "Number files for which the renaming would result in the same name" is activated:

Since the determination of the file name respectively the question of whether your current settings will lead to files of the same name depend on both all other files in the file list as well as on potential other files on your hard drive (for example because they are stored in the same directory as files from the file list, even if they have not been added to the file list), it can be a lot of work for the FileRenamer to create a preview for a file name.

For this reason, the FileRenamer offers you two options with which you can deactivate the preview regarding to two types of review:

However, the deactivation of one or both of these options can lead to the preview of a different number than the file will have later. This will always happen if a file of the same name is already existing on your hard disk or two or more files from your file list would lead to the same name with your settings.

The automatic numbering of same named files takes place regardless of the numbering with the placeholder %num%, which options were presented in the first section of this tutorial.

Change existing Numbering of Files

For changing an existing numbering of files, the FileRenamer offers you many options. It's easiest if you want to sequentially renumber a series of files that are already sequentially numbered. In this case, you can use the functions presented so far in this tutorial. First, you can configure your desired initial value as well as your desired increment value via the menu "Settings > Numbering", then you can use the placeholder %num% in any text field of the functions for changing the file name in the FileRenamer.

Modification of Consecutive Numberings

To change a consecutive existing numbering, for example, the replace function of the FileRenamer can be used. For example, you can search for the regular expression [0-9]+ and replace it with the placeholder %num% (the option "Interpret as Regular Expression" must be activated for this). With the regular expression [0-9]+ you can find all previous numbers in the file names (regardless of which numbers those are) and replace them with the new numbering using the placeholder %num% using all settings and options of this placeholder.

Increase or Decrease of existing Numberings

But what can we do if the numbering is not consecutive? Let's say we have the files "file000.txt", "file001.txt", "file004.txt" and "file007.txt". The numbering starts at "000" here, but we want the numbering to start at "001" instead, while keeping the "gaps" in the numbering. Accordingly, the files should be renamed to "file001.txt", "file002.txt", "file005.txt" and "file008.txt". We cannot work with the %num% placeholder at this point, since the numbering of the files does not follow any rule and we can therefore not define a uniform increment of the value. Instead, the numbering depends solely on the original number, which we want to increase by 1.

In this case, we can use the function "Number Adjustment", which you can find in the FileRenamer under "Changes > Name or Extension > Number Adjustment". With this function it is possible to increase or decrease existing numbers within file names by any value.

The function provides you with two options:

Let's look at an example for this. We have a file named "100-AB-30 (001).dat" and we want to add "1" only to the number "001" in it. Accordingly, we enter "1" as increment. If we would leave the position at "0", all numbers of the filename would be increased and we would get the result "101-AB-31 (002).dat". Since "001" is the third number within the filename, we could set the position to "3" and we would get our desired result "100-AB-30 (002).dat". However, if we want to rename other files like "100-33-30 (002).dat" or "200-AB-XY (003).dat" at the same time, counting the numbers from the beginning would not work and we would get "100-33-31 (002).dat" instead of "100-33-30 (003).dat". In this case, it would be better to define "-1" as the position so that the position is counted from the back. This would increase the number in brackets for all 3 files.

As you can see from this example, the function respects leading zeros. With an increase of 1, "001" becomes "002" and "009" becomes "010".

Add or reduce Leading Zeros of existing Numberings

Also if you want to change the number of leading zeros of existing numberings or other numbers in the file name, you can use the "number adjustment" function introduced in the last section.

Since we do not want to change the numerical value in this case, we set the increment to "0". On the other hand, in the field "Leading Zeros" we can define the number of zeros we want. The field "Position" can be used in the same way as described in the last section ("0" changes all numbers, "1" the first number from the front, "-2" the secound number from the end and so on).

The examples have demonstrated how the option can be used to both increase and decrease the number of leading zeros used in file names.