Find partial match file name and replace all file name

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Find partial match file name and replace all file name

Postby onnadaitaro » Wed Jul 03, 2019 10:44 am

Hi...

Kindly help. i have a directory for all my movie files, I want to make the file name same as the cover file name (jpg). I put them all in one directory.

Example:
aqsh-011.mp4 need change to lorem ipsum2 - AQSH-011.mp4
baburu-007.mp4 need change to lorem ipsum3 - BABURU-007.mp4
BCDP-091.mp4 need change to lorem ipsum4 - BCDP-091.mp4
BF521.mp4 need change to lorem ipsum5 - BF-521.mp4
names_blk-332.mp4 need change to lorem ipsum6 - BLK-332.mp4
namos brk-06.mp4 need change to lorem ipsum7 - BRK-06.mp4

So in the same directory i already put files:
lorem ipsum2 - AQSH-011.jpg
lorem ipsum3 - BABURU-007.jpg
lorem ipsum4 - BCDP-091.jpg
lorem ipsum5 - BF-521.jpg
lorem ipsum6 - BLK-332.jpg
lorem ipsum7 - BRK-06.jpg

Kindly help what to do in the BRU interface.

Thanks B4
onnadaitaro
 
Posts: 3
Joined: Wed Jul 03, 2019 10:31 am

Re: Find partial match file name and replace all file name

Postby therube » Thu Jul 04, 2019 11:40 am

I put them all in one directory.

Are all the jpg/mp4 in 1 directory?
Or is each jpg/mp4 pair in its own individual directory.

DIR/ 1.jpg 1.mp4 2.jpg 2.mp4 3.jpg 3.mp4 ...

DIR1/ 1.jpg 1.mp4
DIR2/ 2.jpg 2.mp4
DIR3/ 3.jpg 3.mp4 ...
therube
 
Posts: 1393
Joined: Mon Jan 18, 2016 6:23 pm

Re: Find partial match file name and replace all file name

Postby onnadaitaro » Tue Jul 23, 2019 2:03 am

yes. in one directory.

how to put these commands? sorry. I'm new using BRU.
onnadaitaro
 
Posts: 3
Joined: Wed Jul 03, 2019 10:31 am

Re: Find partial match file name and replace all file name

Postby onnadaitaro » Tue Jul 23, 2019 2:05 am

sorry. i missed you meaning.
it all in one directory:

DIR/ 1.jpg 1.mp4 2.jpg 2.mp4 3.jpg 3.mp4 ...
onnadaitaro
 
Posts: 3
Joined: Wed Jul 03, 2019 10:31 am

Re: Find partial match file name and replace all file name

Postby bru » Mon Jan 27, 2020 12:08 pm

BRC doesnt have that functionality, here's a batch for it:

@echo off
SetLocal EnableDelayedExpansion
For /f "delims=" %%A IN ('dir/b "* - *.jp*g"') DO (
(Set name=%%~nA) && (Set name=!name:* - =!)
For /f "delims=" %%B IN ('dir/b "!name!.mp*"') DO If not exist "%%~nA%%~xB" @echo @ren "%%B" "%%~nA%%~xB")
pause>nul

Run it with @echo to preview how it creates your rename-commands.
If it's what you're looking for, then remove @echo from the batch.
bru
 
Posts: 62
Joined: Wed Jan 31, 2018 7:35 pm


Return to BRU Support