in reply to File renaming and removal to a subdirectory
Hi Joes this snippet will rename all the files in a directory that end in $from so they end in $to for you. As every operating system has some form of copy a -> b function using it will be the quickest way to achieve the second part of your goal.
my $dir = "c:/"; my $from = '.puz'; my $to = 'A.puz'; while (<$dir*$from>) { my ($old,$new); $old = $new = $_; $new =~ s/$from$/$to/; rename $old, $new; }
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: File remaing and removal to a subdirectory
by Joes (Acolyte) on Jul 12, 2001 at 10:53 UTC | |
by tachyon (Chancellor) on Jul 12, 2001 at 11:13 UTC |