Can Bulk Rename Command Line Do More than One Rename Process

Bulk Rename Utility How-To's

Can Bulk Rename Command Line Do More than One Rename Process

Postby Bulky » Fri Dec 27, 2024 3:32 pm

I am looking to streamline the process of renaming my HDHomeRun's movie filenames for scraping into a Media Manager.

The move names generally come in two flavors as they are created and placed in the DVR's movie folder.

The Long Riders 19800101 [20241227-0500].mpg

Thunder Over the Plains [20241227-0900].mpg

The goal is to get rid of everything after the title of the movie. IE. The Long Riders and Thunder Over the Plains

With the new version of Bulk Rename Utility GUI, I can do that with the Special (14) Order in one click.

Can that same thing be done with the command line of Bulk Rename? IE. BRC64.exe

To me it looks like these pairs of numbers are the key with no space between them. I say that because some movies do have legitimate numbers in them like Lethal Weapon 2, Big Hero 6.

I know this is a tall order. Media Companion will do the scraping by command line if I can get the renaming cleaned up as above. Then both could be run through a batch file with one click.
Bulky
 
Posts: 11
Joined: Wed Dec 25, 2024 5:34 pm

Re: Can Bulk Rename Command Line Do More than One Rename Process

Postby therube » Fri Dec 27, 2024 9:30 pm

Would something like this do it?

Code: Select all
BRC64.exe   /DIR:.   /PATTERN:*.mpg  /REGEXP:(.*)\s\[(\d+-\d+)\](.*):"\1\3"


find anything
followed by a <sp>[
followed by digit(s) <dash> digit(s)
followed by a ]
(& if anything should come after that ], simply copy that too)

Code: Select all
Processing Folder .\
Filename The Long Riders 19800101 [20241227-0500].mpg would be renamed to
    The Long Riders 19800101.mpg
Filename Thunder Over the Plains [20241227-0900].mpg would be renamed to
    Thunder Over the Plains.mpg
therube
 
Posts: 1430
Joined: Mon Jan 18, 2016 6:23 pm

Re: Can Bulk Rename Command Line Do More than One Rename Process

Postby Bulky » Fri Dec 27, 2024 10:21 pm

That is pretty good actually. But I would not want to keep the 19800101 either.

Filename The Long Riders 19800101 [20241227-0500].mpg would be renamed to The Long Riders 19800101.mpg

However, after much playing around with BRC64, I have found this works below, except any movie that opts to use a number for a sequel; or in the spirit of Christmas, "Home Alone 2."

The "2" could get axed.

BRC64.exe /DIR:"E:\Test Fake Videos" /STRIPDIGITS /STRIPSYMBOLS /TRIM /EXECUTE /QUIET
Bulky
 
Posts: 11
Joined: Wed Dec 25, 2024 5:34 pm

Remove trailing number-strings with BRC

Postby Luuk » Sun Dec 29, 2024 2:41 am

Greetings everyone! To remove number-strings like in the samples, could try something like...
/RegExp:"(.+?)( \d{8})? \[\d{8}-\d{4}\]$:\1"
Luuk
 
Posts: 811
Joined: Fri Feb 21, 2020 10:58 pm

Re: Can Bulk Rename Command Line Do More than One Rename Process

Postby Bulky » Sun Dec 29, 2024 5:57 pm

Thank you for your time.

I put /RegExp:"(.+?)( \d{8})? \[\d{8}-\d{4}\]$:\1" in the Match RegEx (1) field highlighting a test file I made up, Gone with the Wind 2 2356989 [454545-454545], and nothing at all happens. So I must not be understanding it's usage. Sorry. :-(
Bulky
 
Posts: 11
Joined: Wed Dec 25, 2024 5:34 pm

Remove trailing number-strings with BRC

Postby Luuk » Sun Dec 29, 2024 6:43 pm

The made-up test name does not terminate with number-strings like in the samples.
But if you need to also remove strings like in the made-up name, can change it to...
/RegExp:"(.+?)( \d{7,8})? \[\d{6,8}-\d{4,6}\]$:\1"

The Long Riders 19800101 [20241227-0500] --------> The Long Riders
Thunder Over the Plains [20241227-0900] -----------> Thunder Over the Plains
Gone with the Wind 2 2356989 [454545-454545] ---> Gone with the Wind 2
Luuk
 
Posts: 811
Joined: Fri Feb 21, 2020 10:58 pm

Re: Can Bulk Rename Command Line Do More than One Rename Process

Postby Bulky » Sun Dec 29, 2024 8:35 pm

I'll admit for my batch processing those are the results I am looking for! :-)

So I edited my batch file with the following line based on your syntax.

BRC64.exe /DIR:"L:\Movies" /RegExp:"(.+?)( \d{7,8})? \[\d{6,8}-\d{4,6}\]$:\1"

The batch file is in the same directory as the BRC64.exe.

Unfortunately nothing happens. It just moves onto the next step on the batch file leaving the original name intact.

I used this filename as the sample: Gone with the Wind 2 2356989 [454545-454545].mpg

The old syntax works BRC64.exe /DIR:"L:\Movies" /STRIPDIGITS /STRIPSYMBOLS /TRIM /EXECUTE /QUIET, but as we noted earlier, it removed the "2" Gone with the Wind 2.

Now in case I had my wires crossed, putting /RegExp:"(.+?)( \d{7,8})? \[\d{6,8}-\d{4,6}\]$:\1" in the Match RegEx (1) field, highlighting the same test file, Gone with the Wind 2 2356989 [454545-454545], and nothing at all happens. No changes are previewed to be made.

I know you have this working on your end, the fence-post must be in front of my eyes on my end.
Bulky
 
Posts: 11
Joined: Wed Dec 25, 2024 5:34 pm

Remove trailing number-strings with BRC

Postby Luuk » Sun Dec 29, 2024 9:34 pm

Without /Execute the BRC wont rename anything, and instead presents a preview of the new-names.
So the whole command inside of your batch file, to look something like...

"C:\PathTo\Your\BRC64.exe" /Dir:"L:\Movies" /RegExp:"(.+?)( \d{7,8})? \[\d{6,8}-\d{4,6}\]$:\1" /Execute
Luuk
 
Posts: 811
Joined: Fri Feb 21, 2020 10:58 pm

Remove trailing number-strings

Postby Luuk » Sun Dec 29, 2024 9:50 pm

If you want to test the regex with BRU, then BRC's format is /RegExp:"Match:Replace"
So inside of RegEx(1) the "Match" and "Replace" would be...
(.+?)( \d{7,8})? \[\d{6,8}-\d{4,6}\]$
\1
Luuk
 
Posts: 811
Joined: Fri Feb 21, 2020 10:58 pm

Re: Can Bulk Rename Command Line Do More than One Rename Process

Postby Bulky » Sun Dec 29, 2024 10:09 pm

Wow, almost like a masterpiece. Beautiful. Worked like a charm.

I tried Home Alone 2 with all the numbers and such afterwards and came out perfect keeping the 2 in Home Alone 2.

Thank you!, I indeed forgot the /Execute. :-)
Bulky
 
Posts: 11
Joined: Wed Dec 25, 2024 5:34 pm


Return to How-To