Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Remove (nearly) duplicate files recursively

by wrinkles (Pilgrim)
on May 19, 2008 at 10:22 UTC ( #687337=note: print w/replies, xml ) Need Help??


in reply to Re: Remove (nearly) duplicate files recursively
in thread Remove (nearly) duplicate files recursively

Thanks moritz, here's the updated code:
#!/usr/bin/perl -w use strict; use File::Find; find(\&process, '/Users/Shared/Music'); sub process { my $song = $File::Find::name; my $orig = $song; $orig =~ s/ 1\.mp3/.mp3/; if ( (m/[\d\D]*\s+1.mp3$/) && (-e $orig) ){ rename "$song", "/Users/wrinkles/dupes/$_" or die $!; print "$song removed. \n"; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://687337]
help
Chatterbox?
and the universe expands...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2016-12-09 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (153 votes). Check out past polls.