[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

Find and Replace

Seeking to quickly locate files on my storage device that have common names like:

example01, example02, example03.....and rename them as:  red01, yellow02, green03

Using Windows 7.  Former versions of had FileManager and other tools that used wildcards to quickly search and replace.  The Search tool in Windows 7 works great, but haven't found a replace feature that works with the search.

Someone find a solution?
0
clock1
Asked:
clock1
  • 3
1 Solution
 
pony10usCommented:
You can open a command line and enter this command:

for /f "delims=*" %a in ('dir example01.* /b /s') do ren "%a" red01.*

repeat for each one:

for /f "delims=*" %a in ('dir example02.* /b /s') do ren "%a" yellow02.*

etc.

or you should be able to create a batch file with all commands:

@echo off
for /f "delims=*" %a in ('dir example01.* /b /s') do ren "%a" red01.*
for /f "delims=*" %a in ('dir example02.* /b /s') do ren "%a" yellow02.*
for /f "delims=*" %a in ('dir example03.* /b /s') do ren "%a" green03.*
0
 
clock1Author Commented:
Is DOS the only alternative?
0
 
Gerald ConnollyCommented:
Well its probably the easiest, you could do it with Perl, but that is a bit more complicated
0
 
clock1Author Commented:
Or could use FileTree.xla to produce recurrsive directory tree in Excel and use Find/Replace there.
0
 
clock1Author Commented:
In this case, works best for me.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now