Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Renaming all files (38gb :) in a folder and subfolders with one command?

Posted on 2010-11-17
13
Medium Priority
?
462 Views
Last Modified: 2012-06-22
Hi experts

I need to rename all files in folders/subfolders in the following way:

every space should be removed from its name.

there are names like:

gastro de manuel solis.bmp
2020 examen de videoscopia rectal.bmp

etc.

thanks.

There are about 500000 of thes files.

Bye.
0
Comment
Question by:aguisa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 2
  • +1
13 Comments
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 34161013
I would just download Oscar's Renamer and do a find/replace and replace a space with nothing.
http://www.mediachance.com/free/renamer.htm
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 34161014
It's a really useful tool. Even supports recording macros.
0
 

Author Comment

by:aguisa
ID: 34161051
Other way of doing this and not compromising my PC with any installed software?

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 58

Expert Comment

by:Bill Prew
ID: 34161054
Do you need to do this in MSDOS, or Linux?

~bp
0
 

Author Comment

by:aguisa
ID: 34161088
I mean something like:


ren | more | dir /s |. .....

or in linux maybe


thanks.
0
 
LVL 9

Expert Comment

by:bz43
ID: 34161096
What is the OS that the files are on?  Then we can create a command line tool for you.  If it's MS-DOS then which version.  If it's Windows 7 but you want to use the command line let us know.  Thanks!
0
 

Author Comment

by:aguisa
ID: 34161116
I have Windows XP Media Center SP3, and UBUNTU 10.10

Either the first or the second would be fine,

both would be greatly appreciated, just for the records and by the way,

thanks.
0
 

Author Comment

by:aguisa
ID: 34161119
The harddrive with the files is external USB
0
 
LVL 58

Accepted Solution

by:
Bill Prew earned 2000 total points
ID: 34161170
Here's a BAT script that should do it in Windows DOS.

@echo off
setlocal EnableDelayedExpansion
set BaseDir=c:\temp
for /F "tokens=*" %%A in ('dir /a-d /s/b "%BaseDir%"') do (
  set OldName=%%~nA
  set NewName=!OldName: =!
  ren "%%A" "!NewName!%%~xA"
)

Open in new window


~bp
0
 

Author Comment

by:aguisa
ID: 34161231
No bp, i get the following :


The system cannot find the file specified.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
^CTerminate batch job (Y/N)?
0
 

Author Comment

by:aguisa
ID: 34161243
wait....



it worked like magic, and actually in 5 seconds,

the error was for the non containing blanks case.


BP is a genius undoubtedly. Thanks alot
0
 

Author Closing Comment

by:aguisa
ID: 34161253
Usability of this Bat function is really amazing. Thanks thanks
0
 
LVL 58

Expert Comment

by:Bill Prew
ID: 34161276
Great, glad that was helpful.  If you wanted to only rename when the filename changed, this change would handle that.

~bp

@echo off
setlocal EnableDelayedExpansion
set BaseDir=c:\temp
for /F "tokens=*" %%A in ('dir /a-d /s/b "%BaseDir%"') do (
  set OldName=%%~nA
  set NewName=!OldName: =!
  if "!OldName!" NEQ "!NewName!" ren "%%A" "!NewName!%%~xA"
)

Open in new window

0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question