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
- Other Placeholders for the Numbering
- Numbering of Same-Named Files
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.
- Example 1: If you would like to make a file numbering, in which the number of the file is either prepended to the front of the existing file name or is attached to the back of the existing file name, you can use the function "Append" and simply write the text "%num%" in one of the two fields "Prepend this text to the front" or "Append this text at the back".
- Example 2: Of course, you can also combine the %num% placeholder with other characters, for example " (%num%)" to put the number of the file in brackets and to separate it with a space from the rest of the name. You could achieve the same result with the function "Mask" and the text "%name% (%num%)", with the placeholder %name% standing for the old file name in the mask.
In the menu of the FileRenamer under "Settings > Numbering" you can find some settings with which you can influence the %num% placeholder:
- Initial Value: By default, the initial value is "1". This means that the counting begins at 1 and the placeholder %num% is accordingly replaced by "1" for the first file in the file list. If you enter a different numerical value here, you can start the counting with any other number. For example with "0" (which makes the first file in the file list to have the number 0 and the second file in the file list becomes the 1) or with 10, 100 or an arbitrary other value. Even negative values are possible.
- Increment: Also the increment is "1" by default. This means that the counting is increased by 1 with each new file in the file list. When we start the counting with an initial value of 1 and we use an increment of 1, %num% will be "1" for the first file, "2" for the second file, "3" for the third file and so on. If we set the increase to "2" instead, the first 3 files in the list would be counted as 1, 4 and 7. Again we can also work with negative values. If we set the initial value, for example, to "10" and the increase to "-1", the placeholder %num% would be replaced by the values 10, 9 and 8 for the first 3 files in the file list.
- Fixed Length with Leading Zeros: With this option you can determine whether the numbers should be written without or with an arbitrary number of leading zeros. Especially with countings having a different number of characters (for example from one character of "1" up to 3 characters at "100"), it can look more beautiful if the numbers are written as "001", "002", ... "010" ... "100" in the file names instead of "1", "2", "10" and "100". If you enter "0" or "1" here, the numbers are written without leading zeros (1, 2, 3). With an indication of "3" you get the example above (001, 002, 003) or with "2" you get a series like "01", "02" and so on.
- Reset Numbering with every new Folder: If this option is activated, the counting is reset to the value from the field "initial value" with each file in the file list that is located in a different folder than the file before. Let us assume that we have an initial value of "1" and in our file list there are first 10 files from folder A and then 10 more files from folder B. If the option is activated, the first 10 files will receive the numbers 1 to 10. Since the eleventh file in the list is from a different folder than the tenth file in the list, the counting is reset at the eleventh file to the initial value "1" and the files 11 to 20 are again provided with the numbers 1 to 10. However, if this option is not activated, the folders do not play a role in the count. In this case, the same files would be numbered as 1 to 20.
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:
- %0num%, %00num%, %000num% and so on - Alternatively, you can control the number of leading zeros also without the setting "Fixed Length with Leading Zeros". While the placeholder %num% always adheres to this setting, the placeholders %0num%, %00num%, %000num% and so on are working independently of it. The placeholder %0num% corresponds to a setting of "2", the placeholder %00num% to a setting of "3" and so on. The other settings except the configuration of the leading zeros such as the settings for the initial value and the increment also apply to these placeholders in the same way like %num%.
- %abs0num% - If you do not want to care about the maximum number of characters of the number, you can alternatively use the placeholder %abs0num%. Also this placeholder works regardless of the setting "Fixed Length with Leading Zeros" and instead is based on the number of files in the list. Using the placeholder "%abs0num%", for 1 to 9 files in the file list, the number of the numbering is inserted without any leading zeros. From 10 files up to a maximum of 99 files in the file list, leading zeros are used to fill the number to a length of always 2 characters, from 100 files up to 999 it is always filled to 3 characters and so on.
- %abs% - In connection with the placeholders for the numbering, also the placeholder %abs% should not remain unmentioned, which stands for the absolute number of files in the list. As an example, you could use the function "Append > Prepend Text" with the text "%num% of %abs% ". If you have a total of 3 files in your file list, this would write "1 of 3 ", "2 of 3 " and "3 of 3 " in front of the 3 files. You could get the same result with using the mask "%num% of %abs% %name%", in which the placeholder %name% stands for the old name of the file.
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".
- If this option is activated, files or folders of the same name after renaming are numbered, so that each file and folder gets a unique name again.
- If this option is not activated, files of potentially the same name lead to a warning message in the FileRenamer without renaming files. This gives you the chance to change your settings manually without the FileRenamer having done any automatic numbering.
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:
- Mask: In the field "Mask", you can define a mask that serves as a pattern describing how the names of the files with a same name, which are numbered, should look like. The function is similar to the mask function from the main window of the FileRenamer. The mask must contain the placeholders %name% (name of the file after renaming) and %num% (number of numbering) and can contain any other characters that are allowed in file names. By default, "%name% (%num%)" is used as a mask. If, as an example, two files would get the same name "abc.txt" after applying all settings, the mask "%name% (%num%)" combined with the default settings (initial value of 1, increase of 1 and no leading zeros), would lead to the two file names "abc (1).txt" and "abc (2).txt" after renaming. If we work instead with an initial value of 0, an increase of 1 and 4 fixed zeros, the same case would lead to a renaming to the file names "abc (0000).txt" and "abc (0001).txt".
- Initial Value, Increment and Fixed Length with Leading Zeros: With these fields you can define the initial value of the counting (by default 1 for the first file), the increment of the counting with each new file (by default 1 per file) and the number of leading zeros used before the number. These options work the same way like the fields of the same name described in the section about the numbering with the placeholder %num%. Therefore, we do not want to go into this further at this point, but only refer to the section above.
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:
- Activate Preview for Same-Named-Files-Renaming (slowly for a large number of files): This option only refers to files that are in the current file list. If this option is activated, all files of the file list are reviewed when creating the preview and checked whether two files would receive the same name. If so, the preview is adjusted according to the current mask for files of the same name. If you have a lot of files in your file list that you want to rename at the same time, the deactivation of this function can make the program faster. With a few files in the file list, it shouldn't be a problem if this option is activated and all files are checked when creating the preview.
- Check for Files stored on Hard Drive for the Preview (even slower): If this option is activated, not only the files from the file list within the program are taken into account, but also the other files that are stored in the same folders as the files from the file list. If you deactivate this option, hard disk access can be switched off while creating the preview.
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.