Replace space with "_" in file names

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
osramos
Posts: 5
Joined: 27 Sep 2008 04:31

Replace space with "_" in file names

#1 Post by osramos » 03 Oct 2008 07:18

Hi there,

I need some help with this:

I have some directories with *.xls files ( Hundreds ), and i was wondering if there is something to replace the space's with "_" on every file i found, or is it's more simple remove only the space between words

Example:

EDF Segur 200807.xls
EDF Segur 200808.xls
EDFSt Bernabe 200801.xls

Output needed:

EDF_Segur_200807.xls
EDF_Segur_200808.xls
EDFSt_Bernabe_200801.xls
EDF_St_Bernabe_200801.xls

Can anyone help ?

Regards,

osramos

greenfinch
Posts: 36
Joined: 17 Jul 2008 07:37

#2 Post by greenfinch » 06 Oct 2008 06:27

I'm sure it's possible but my immediate thought was to use something like RenameMaster:
http://www.joejoesoft.com/cms/showpage.php?cid=108

It's free and very handy

DGMakers
Posts: 13
Joined: 30 Jun 2008 04:28

#3 Post by DGMakers » 11 Jan 2009 03:00

SET var=%var: =_%

that will replace " " with "_"

so just use the file rename command and use that with it =D

jaffamuffin
Posts: 40
Joined: 25 Jan 2008 14:05

#4 Post by jaffamuffin » 18 Feb 2009 00:13


Post Reply