How to rename almost same names files, but small part of it?

Bulk Rename Utility How-To's

How to rename almost same names files, but small part of it?

Postby Guy » Tue Jan 25, 2022 4:37 pm

Hi,

I have some video files that should be renamed most of the parts (as you see below example), except the number of episodes, and add give the episode's number with the correct number in this case? If I use the "Replace (3) section, it renames the whole file name and I can't keep and protect the episode's number from renaming to recognize them later.

Adding the episode's name (in the parentheses) is not tough and I can't add manually outside of Bulk Rename Utility or it can be another question how to do it in BRU, but the most important thing about this; it's how to rename many files like this example and keep those episodes numbers after removing the extra dots between words?

Imagine this is your challenge, how to rename some files from A to B in one or more steps?

A------ Before B--------After

Sons.Of.Anarchy.S02E01.Bluray.720p.x265 ------> Sons of Anarchy - Seasnon 2 - Episode 1 = [episode's name]
Sons.Of.Anarchy.S02E02.Bluray.720p.x265 ------> Sons of Anarchy - Seasnon 2 - Episode 2 = [episode's name]
Sons.Of.Anarchy.S02E03.Bluray.720p.x265 ------> Sons of Anarchy - Seasnon 2 - Episode 3 = [episode's name]
Sons.Of.Anarchy.S02E04.Bluray.720p.x265 ------> Sons of Anarchy - Seasnon 2 - Episode 4 = [episode's name]
Sons.Of.Anarchy.S02E05.Bluray.720p.x265 ------> Sons of Anarchy - Seasnon 2 - Episode 5 = [episode's name]
.
.
.
.

Best,
Guy
Guy
 
Posts: 16
Joined: Wed Jan 19, 2022 8:27 am

Re: How to rename almost same names files, but small part of it?

Postby Luuk » Tue Jan 25, 2022 7:55 pm

With RegEx(1) can put a checkmark inside "v2", with a "Match" and "Replace" like...
\./g(?X)(.+ )S0?(\d{1,2})E0?(\d{1,2}).*
\ (?X)$1- Season $2 - Episode $3

The episode name might be added at the same time, but only if the bru can see your file's episode name.
First to put checkmark in the menu "Renaming Options, ID3/Exif Data/File Properties, Extract Windows File Properties"
Then you can right-click on any file to "Show List of File Properties" to look for the proper metadata name.

Like if you find the file's episode name inside some metadata called System.Video.EpisodeName?
Then Add(7) could use a "Suffix" like < = (System.Video.EpisodeName)>
Luuk
 
Posts: 692
Joined: Fri Feb 21, 2020 10:58 pm

Re: How to rename almost same names files, but small part of it?

Postby Guy » Tue Jan 25, 2022 9:31 pm

Luuk wrote:With RegEx(1) can put a checkmark inside "v2", with a "Match" and "Replace" like...
\./g(?X)(.+ )S0?(\d{1,2})E0?(\d{1,2}).*
\ (?X)$1- Season $2 - Episode $3

The episode name might be added at the same time, but only if the bru can see your file's episode name.
First to put checkmark in the menu "Renaming Options, ID3/Exif Data/File Properties, Extract Windows File Properties"
Then you can right-click on any file to "Show List of File Properties" to look for the proper metadata name.

Like if you find the file's episode name inside some metadata called System.Video.EpisodeName?
Then Add(7) could use a "Suffix" like < = (System.Video.EpisodeName)>


Hi Lukk,

I use those RegEx commands and worked! RegEx is really magic and cool. it's very useful and likes to learn more about it in a simple way.

Sorry; I should have written those episodes' names to see how BRU add them; as you said "it might be added at the same time". I use "Show List of File Properties". In there I found some useful metadata info but didn't find anything for the episodes' names. But Wikipedia helped me to find those names and I copy/paste them here. You replied to my post clear, but I'm new with BRU and RegEx and didn't understand the last line of your post and tried some times and the preview didn't show the right thing of different names for each episode to give a unique name for each episode. Would you please rewrite those RegEx with different names for each episode again to learn it for a lot of series I should rename?

Sons of Anarchy - Season 2 - Episode 1 = Albification
Sons of Anarchy - Season 2 - Episode 2 = Small Tears
Sons of Anarchy - Season 2 - Episode 3 = Fix
Sons of Anarchy - Season 2 - Episode 4 = Eureka
Sons of Anarchy - Season 2 - Episode 5 = Smite

Thank you!
Guy
 
Posts: 16
Joined: Wed Jan 19, 2022 8:27 am

Re: How to rename almost same names files, but small part of it?

Postby Luuk » Wed Jan 26, 2022 9:09 am

If the episode-names do not present after "Show List of File Properties", then bru cannot add them into the filename.
But there is many applications for adding them, if the episode-name is somewhere else inside of the file's $metadata.
For myself, Im always using the free exiftool.exe for $metadata that the bru cannot see.

With the exiftool.exe, you can search for the $metadata that does hold episode-names with a command like...
exiftool -s "C:/Path/To/YourVideoFilename.mp4" and then the exiftool will present like...
Metadata1.... : Value1
Metadata2.... : Value2

So if any $metadata presents the value for your "Episode Name", then its very easy adding them into the filenames.
But first, I would need to know the $Metadata on the left, and also the different file-extensions to be conducted?
Luuk
 
Posts: 692
Joined: Fri Feb 21, 2020 10:58 pm


Return to How-To