I have a ton of files with %20s in the name, looking for program that replaces %20 with a space

Eeezee

Diamond Member
Jul 23, 2005
9,922
0
76
I have a bunch of files with %20s instead of spaces (it seems wxDownload Fast combined with Flashgot = every %20 got included in the filename instead of taken as a space). Is there a program out there that will quickly and easily rename all of these files and replace every %20 with a space?
 

nova2

Senior member
Feb 3, 2006
982
1
0
no problem.
use lupas rename (free)
http://www.google.com/search?&q=lupas%20rename

or this windows perl script
# rename filenames using search and replace

# Usage: rename perlexpr [files]

# file:///J:/sw/file_renaming/Renaming%20Files%20with%20Perl.htm
# includes *nix version.

# eg on windows: perl rn.pl "s/searchfor/replacewith/" *
# in nix, you may need to use ' ' instead

use File::Glob qw:)glob); # needed if you want this to work on windows
use warnings;

($regexp = shift @ARGV) || die "Usage: eg on windows: rn.ple \"s/oldtext/newtext/\" *".
"\n Case sensitive by default.\n";

if (!@ARGV) {
@ARGV = <STDIN>;
chomp(@ARGV);
}


foreach $_ (bsd_glob(@ARGV, GLOB_NOCASE)) {
$old_name = $_;
eval $regexp;
die $@ if $@;
rename($old_name, $_) unless $old_name eq $_;
print "$_\n" unless $old_name eq $_; # enable this if you want to see the renamed files listed
}

exit(0);