Rename with txt file

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

Rename with txt file

Postby faxinger » Mon Sep 28, 2015 7:22 am

Hi, I searched the forum but did not find a satisfying answer.

So what I want to do:

I have hundreds of wav files with various names in many different folders.
Theyr names varies but what they all have is the note name in filename.
For example: bass_F-2.wav, 5538syn_G#3.wav, guitar58ouixyz_A0.wav and so on.
What I want is: bass_F-2 - (5).wav, 5538syn_G#3 - (78).wav, guitar58ouixyz_A0 - (33).wav

I want to replace _F-2 with _F-2 - (5), There are 128 different note numbers and they all have to be added the midinotenumber = ().
I have an excelfile or txt with all notenumbers and midinotes. But how can I tell BUR just to replace this specific part of the name in all files with this list?

I hope you understand what I want to do.

Thanks for your help
faxinger
 
Posts: 4
Joined: Mon Sep 28, 2015 7:05 am

Re: Rename with txt file

Postby faxinger » Mon Sep 28, 2015 8:05 am

PS: this is how my txt file looks like - to make it more clear what i want:

_C-20|_C-20 - (0)
_C#-21|_C#-21 - (1)
_D-22|_D-22 - (2)
_D#-23|_D#-23 - (3)
_E-24|_E-24 - (4)
_F-25|_F-25 - (5)
_F#-26|_F#-26 - (6)
_G-27|_G-27 - (7)
_G#-28|_G#-28 - (8)
_A-29|_A-29 - (9)
_A#-210|_A#-210 - (10)
_B-211|_B-211 - (11)
_C-112|_C-112 - (12)
_C#-113|_C#-113 - (13)
_D-114|_D-114 - (14)
_D#-115|_D#-115 - (15)
_E-116|_E-116 - (16)
_F-117|_F-117 - (17)
_F#-118|_F#-118 - (18)
_G-119|_G-119 - (19)
_G#-120|_G#-120 - (20)
_A-121|_A-121 - (21)
_A#-122|_A#-122 - (22)
_B-123|_B-123 - (23)
_C024|_C024 - (24)
_C#025|_C#025 - (25)
_D026|_D026 - (26)
_D#027|_D#027 - (27)
_E028|_E028 - (28)
_F029|_F029 - (29)
_F#030|_F#030 - (30)
_G031|_G031 - (31)
_G#032|_G#032 - (32)
_A033|_A033 - (33)
_A#034|_A#034 - (34)
_B035|_B035 - (35)
_C136|_C136 - (36)
_C#137|_C#137 - (37)
_D138|_D138 - (38)
_D#139|_D#139 - (39)
_E140|_E140 - (40)
_F141|_F141 - (41)
_F#142|_F#142 - (42)
_G143|_G143 - (43)
_G#144|_G#144 - (44)
_A145|_A145 - (45)
_A#146|_A#146 - (46)
_B147|_B147 - (47)
_C248|_C248 - (48)
_C#249|_C#249 - (49)
_D250|_D250 - (50)
_D#251|_D#251 - (51)
_E252|_E252 - (52)
_F253|_F253 - (53)
_F#254|_F#254 - (54)
_G255|_G255 - (55)
_G#256|_G#256 - (56)
_A257|_A257 - (57)
_A#258|_A#258 - (58)
_B259|_B259 - (59)
_C360|_C360 - (60)
_C#361|_C#361 - (61)
_D362|_D362 - (62)
_D#363|_D#363 - (63)
_E364|_E364 - (64)
_F365|_F365 - (65)
_F#366|_F#366 - (66)
_G367|_G367 - (67)
_G#368|_G#368 - (68)
_A369|_A369 - (69)
_A#370|_A#370 - (70)
_B371|_B371 - (71)
_C472|_C472 - (72)
_C#473|_C#473 - (73)
_D474|_D474 - (74)
_D#475|_D#475 - (75)
_E476|_E476 - (76)
_F477|_F477 - (77)
_F#478|_F#478 - (78)
_G479|_G479 - (79)
_G#480|_G#480 - (80)
_A481|_A481 - (81)
_A#482|_A#482 - (82)
_B483|_B483 - (83)
_C584|_C584 - (84)
_C#585|_C#585 - (85)
_D586|_D586 - (86)
_D#587|_D#587 - (87)
_E588|_E588 - (88)
_F589|_F589 - (89)
_F#590|_F#590 - (90)
_G591|_G591 - (91)
_G#592|_G#592 - (92)
_A593|_A593 - (93)
_A#594|_A#594 - (94)
_B595|_B595 - (95)
_C696|_C696 - (96)
_C#697|_C#697 - (97)
_D698|_D698 - (98)
_D#699|_D#699 - (99)
_E6100|_E6100 - (100)
_F6101|_F6101 - (101)
_F#6102|_F#6102 - (102)
_G6103|_G6103 - (103)
_G#6104|_G#6104 - (104)
_A6105|_A6105 - (105)
_A#6106|_A#6106 - (106)
_B6107|_B6107 - (107)
_C7108|_C7108 - (108)
_C#7109|_C#7109 - (109)
_D7110|_D7110 - (110)
_D#7111|_D#7111 - (111)
_E7112|_E7112 - (112)
_F7113|_F7113 - (113)
_F#7114|_F#7114 - (114)
_G7115|_G7115 - (115)
_G#7116|_G#7116 - (116)
_A7117|_A7117 - (117)
_A#7118|_A#7118 - (118)
_B7119|_B7119 - (119)
_C8120|_C8120 - (120)
_C#8121|_C#8121 - (121)
_D8122|_D8122 - (122)
_D#8123|_D#8123 - (123)
_E8124|_E8124 - (124)
_F8125|_F8125 - (125)
_F#8126|_F#8126 - (126)
_G8127|_G8127 - (127)


So I hve to differ between 128 cases (like a switch)....
faxinger
 
Posts: 4
Joined: Mon Sep 28, 2015 7:05 am

Re: Rename with txt file

Postby Stefan » Mon Sep 28, 2015 8:25 am

Hi and welcome.

The fifth result of a forum search for "Rename with txt file"

leads me to >> "Renaming From A Text File" thread:

http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=4&t=2555&p=6749&hilit=Rename+with+txt+file#p6749




Read there, scroll down to Step10 (that's what you have already, but you also have to add the extension on your list)
and then follow Step11 to perform the renaming. Note that may work folder-wise only, not for an whole tree.




HTH?
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Rename with txt file

Postby faxinger » Mon Sep 28, 2015 8:48 am

thanks, I read this thread already but this is not exactly what I want.

I just want to rename a part of a filename. The rest of the filename shall be untouched.

So if there is a

"anyname_A-2.wav" the new name shall be: "anyname_A-2 - (9).wav
"anothername_C#-1.wav" shall be: "anothername_C#-1 - (13).wav"

So the important criteria of name changing is everything after:"_" and this can be 128 different cases with variable length. Thats why I would like to use the txt with pairs (like switches)

If I import the whole directory I have to do it manually in excel because the names before "_" differ in length -> sorting is impossible.

Any solutions?
faxinger
 
Posts: 4
Joined: Mon Sep 28, 2015 7:05 am

Rename part of name only, utilize list with pairs and BRC

Postby Stefan » Mon Sep 28, 2015 10:42 am

Replace any occurrence of  "_A-2.wav"    by    "_A-2 - (9).wav" ?

I think BRC is your friend. ( > Bulk Rename Command > http://www.bulkrenameutility.co.uk/Command.php)


1) make a backup of your files

2) put BRC.exe into the PATH, or copy it to the top main folder of your files.

3) create a DOS batch file in that folder too, to execute BRC several times, one for each rename pair:
Code: Select all
@ECHO OFF

REM "anyname_A-2.wav" the new name shall be: "anyname_A-2 - (9).wav
REM "anothername_C#-1.wav" shall be: "anothername_C#-1 - (13).wav"
BRC32.exe  /EXECUTE /REPLACECi:"_A-2":"_A-2 - (9)"
BRC32.exe  /EXECUTE /REPLACECi:"_C#-1":"_C#-1 - (13)"


BRC32.exe  /EXECUTE /REPLACECi:"_C-20":"_C-20 - (0)"
BRC32.exe  /EXECUTE /REPLACECi:"_C#-21":"_C#-21 - (1)"
REM .....
REM .....
REM .....


ECHO DONE!
PAUSE

Utilize a good text editor like Notepad2 to modify your list.
- prefix each line with BRC32.exe /EXECUTE /REPLACECi:"
- change all | to ":"
- suffix each line with "




4) execute the batch




Note:

not much tested here. At least not with many files. I don't have checked/understood if this solution makes really sense in your case.

Could be the batch needs some fine-tuning?

You can add a " >NUL" behind each BRC32.exe line, to avoid the output of the command and so speed up the process.
BRC32.exe /EXECUTE /REPLACECi:"_A-2":"_A-2 - (9)" >NUL

Read the help of BRC to find more possibilities, like " /PATTERN:"*.wav", if need to process *.wav files only (but is case-sensitive)
Maybe you better use /REPLACECi:"_A-2.wav":"_A-2 - (9).wav" ?




HTH?
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Rename with txt file

Postby faxinger » Mon Sep 28, 2015 8:18 pm

Thanks for you answer.

I already found a solution for my problem.
The solution is AntRenamer. In this little proggy you can search and replace only specific part of filenames with a list.
Exactly what I am trying to do.

Thank you
faxinger
 
Posts: 4
Joined: Mon Sep 28, 2015 7:05 am


Return to BRU Support