in reply to problem with removing space
should work nicely...$dir = $ARGV[0]; # get dir from arg list opendir(D, $dir) or die $!; for(readdir(D)) { $file = $_; tr/ /_/; # or tr/ \t\r\n/_/; for tabs and spaces # or s/\s+/_/g; to make multiple whitespace chars into one _ rename("$dir/$file", "$dir/$_"); } closedir(D);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: problem with removing space
by tye (Sage) on Apr 03, 2001 at 21:48 UTC | |
by suaveant (Parson) on Apr 03, 2001 at 21:56 UTC | |
by tye (Sage) on Apr 03, 2001 at 22:00 UTC | |
by suaveant (Parson) on Apr 03, 2001 at 22:08 UTC |