remove spaces from filenames

G

Guest

I am looking for freeware or any windows tools that will remove
spaces/special characters from filenames in a directory. I have a large
number of files in the directory, manually renaming each each one will be
very tedious... Any suggestions?
 
R

Rob Stow

Ancient said:
I am looking for freeware or any windows tools that will remove
spaces/special characters from filenames in a directory. I have a large
number of files in the directory, manually renaming each each one will be
very tedious... Any suggestions?

I have a little home-made app I call "deaccenter" that should do
the job for you.

It takes a config file deaccenter.ini that has lines in it like:
á=a
â=a
ã=a
ä=a
Ã=A
¢=c
ç=c
é=e
ë=e
ê=e
è=e
í=i
ö=o
ô=o
ó=o
ü=o
ß=o

What it does it replace all instance of an accented char in a
filename with the specified un-accented char. In your case you
would need to have a line
=_
in de-accenter.ini, to (for example) replace a space with an
underscore.

It takes one parameter - the starting folder - and processes
*all* files in that folder and its subfolders. It does not
rename folders.

If you want to try this out, let me know and I'll e-mail this
thing to you.
 
P

Pegasus \(MVP\)

Ancient said:
I am looking for freeware or any windows tools that will remove
spaces/special characters from filenames in a directory. I have a large
number of files in the directory, manually renaming each each one will be
very tedious... Any suggestions?

You can do it with this little batch file. I will cope with up
to 8 embedded spaces. Remove the word "echo" in the
last line to activate it.

@echo off
dir /b /a-d *.* > c:\temp.txt
for /F "tokens=*" %%* in (c:\temp.txt) do call :sub %%*
del c:\temp.txt
goto :eof

:sub
echo ren "%*" %1%2%3%4%5%6%7%8%9
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top