Changing the name of one or more files is an elementary thing. But if you want to do a group rename of files, the number of which exceeds several tens or even hundreds, the manual entry of new names can take several hours, or even more. Fortunately, there are special programs as well
some techniques that allow you to minimize time costs and avoid routine manual work. Therefore, if you want to clean up your music or photo collection, give clear names to all stored files, now is the right time to do this. Consider how best to batch rename files that have accumulated on your computer.
A massive change of names depends primarily on what operating system you use. Here are some tricks for the most popular OS:
The easiest way to rename files in this system is inside the explorer (Windows Explorer). First you need to put all the necessary files in a separate directory, so as not to accidentally hook extra documents. Now select them using the combination “Ctrl + A” and with the right mouse button we call the context menu in which we select the “Rename” item. Enter a common name, for example, "wallpaper", and all our selected files will receive new names consisting of a common name and serial number in parentheses ("wallpaper (1)", "wallpaper (2)", "wallpaper (3)" and etc.).
Also, mass renaming of files can be done using the command line. In this case, using “Win + R”, we launch the window of the desired application, type “cmd” in the line, and press “Enter” to open the
command line. In it, use the “cd” command to specify the path to the file folder, for example, for the “pics” folder on the D: \ drive, the command will be the following: cd d: \ pics. Suppose we want to change the file extension from “GIF” to “JPG”. We will use the command "rename" or abbreviated "ren" and write ren * .gif * .jpg. The team itself and the extensions should be separated by a single space.
In this system, file renaming can be performed using the standard "Rename" utility. The command for the Rename utility looks like this:
rename [-v] [-n] [-f] perlexpr [files];
[-v] - show new file names;
[-n] - list the files selected for renaming;
[-f] - overwrite existing files when matching;
perlexpr - the template by which you want to rename.
Suppose, among others, there are files with the extension “TXT” in the folder, and we want to rename them to “mytext.bak”. Then the command will take the form:
rename 's / .txt / .mytext.bak / g' * .txt
Let’s explain what our template means:
s - replacement is required;
/.txt/ - that we replace;
/.mytext.bak/ - new name;
g - global, the operation will affect all detected occurrences.
The rename command can also help with bulk case changes. The expression "rename 'y / az / AZ /' *" converts all names, making them fully capitalized.
Renaming files in this environment is not as convenient and simple as in Windows. Finder initially does not have such a function, but it can be added through Automator. To do this, run this standard application and select "Service". Then in the library go to the item "Files and folders". It has a sub-item called Rename Finder Objects. It must be transferred to the editing area, while refusing to copy. In the window “Service receives”, install “Files or folders”. Then we put “Use this service in the Finder application”, in the renaming parameters themselves, check the box “Show at run time” and set the “Make consistent” parameter. Now it remains only to check and save the settings.
In order to rename files with additional settings (moving, transliterating, searching by tags), it is better to use special universal utilities, such as "SVS RenameFiles", "Multi Renamer", "Advance Renamer", etc.