Can I rename the contents of a folder based on other folder

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

Can I rename the contents of a folder based on other folder

Postby HomieSlice » Wed Apr 19, 2023 10:06 am

Is it possible in BRU to copy the names of files in one folder to the names of files inside another folder.
HomieSlice
 
Posts: 1
Joined: Wed Apr 19, 2023 10:05 am

Re: Can I rename the contents of a folder based on another folde

Postby therube » Wed Apr 19, 2023 4:21 pm

Not straight forward, but you could use the Rename Pairs feature.
And assuming you're able to get a directory listing as you want such that expected pairs end up related correctly between the two directories.

DIR1:
1
2
3

DIR2
a
b
c

Something like...

DIR /B DIR1 > dir1.txt
DIR /B DIR2 > dir2.txt

(now you need a simple way to combine the two... hmm... not so simple ?)

PR dir1.txt dir2.txt -t -m "-s|" > dir_pairs.txt
- that gives you something like this:
1|a
2|b
3|c

Which you then import dir_pairs.txt into BRU.

PR is the (UNIX) "paginate" command.
-m, says to merge the two files
-s, says to use the pipe (|) as the separator
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm

Re: Can I rename the contents of a folder based on another folde

Postby dec » Tue Jun 27, 2023 12:11 am

therube wrote:Not straight forward, but you could use the Rename Pairs feature.
And assuming you're able to get a directory listing as you want such that expected pairs end up related correctly between the two directories.

DIR1:
1
2
3

DIR2
a
b
c

Something like...

DIR /B DIR1 > dir1.txt
DIR /B DIR2 > dir2.txt

(now you need a simple way to combine the two... hmm... not so simple ?)

PR dir1.txt dir2.txt -t -m "-s|" > dir_pairs.txt
- that gives you something like this:
1|a
2|b
3|c

Which you then import dir_pairs.txt into BRU.

PR is the (UNIX) "paginate" command.
-m, says to merge the two files
-s, says to use the pipe (|) as the separator


wow. that is a way above my pay grade - and what i would ever expect BRU to do! even though it does a lot of amazing stuff, albeit a few missing gaps.

(now i have to look up 'Rename Pairs')

just the other day, i actually found the Manual/info that tels me what all those tick boxes ion Repace do. wish i had known earlier. :-)
dec
 
Posts: 67
Joined: Thu Oct 14, 2021 6:31 am


Return to BRU Support