Hey guys
im after a tool to search for a certain character or whatever in whichever directory I specify and replace it with something else
In this example I have a lot of "_" in my music collection folder titles for example:
High_Contrast-Tough_Guys_Dont_Dance
i need a program to search, find and replace the _ with a space (ideally)
cheers
I'd find that useful too, but have never come across anything that can do it.
Everything I've seen works on text within files, Sam, but I can't think of one that works on file names. I'm just wondering, though, whether anything could be done with a batch file?
In one batch file:
for /r c:\filestorename\ %%K in (*.*) do call c:\rename.bat "%%K"
pause
exit
Then in rename.bat:
@echo off
set fname="%~n1"
set ext=%~x1
set fname=%fname:_= %
ren "%~f1" %fname%%ext%
)
Very rough and ready, but tested and working. :)
It could be spruced up a bit to perhaps ask for the directory that contains the files to be renamed, for example.
Thanks, Sebby. :thumb:
excellent :)
edit:
how do i use it
i put it in my music directory and as follows
1st batch:
for /r D:\My Music\ %%K in (*.*) do call D:\My Music\rename.bat "%%K"
pause
exit
rename batch:
@echo off
set fname="%~n1"
set ext=%~x1
set fname=%fname:_= %
ren "%~f1" %fname%%ext%
)
You probably need to do "D:\My Music\" and "D:\My Music\rename.bat" because of the spaces.
I use the freeware Bulk Rename Utility, which amongst many options has a "replace x with y" function.
http://www.bulkrenameutility.co.uk/Main_Intro.php
That's much better than my solution, thanks. :thumb: