How can I locate missing files using Perl?

Adam Howell September 2, 2011
Pinterest Stumbleupon Whatsapp

I have a large CD collection that I have ripped to .aac on my hard drive. I recently noticed that some albums are missing track 1, but have the rest of the tracks. I need a good way to locate albums that need to be re-encoded.

My ripper (WinAmp) formatted the filenames – – – . An example filename looks like this:
Rush – Presto – 01 – Show Don’t Tell.m4a

“TrackNumber” is zero-padded so it will always be two digits. So I need a list of every directory that has .m4a files in it, but NONE of the filenames contain ” – 01 – “. I have already piped “ls -aR1” to a text file.

I considered using diff against a file with “- 01 -” and one with “- 02 -” to meet my needs, but want to know Perl a little bit better.

Ads by Google

  1. Tina
    September 4, 2011 at 11:20 am

    Adam,

    did the information provided by ha14 help to solve your issue? Please let us know!

  2. Anonymous
    September 3, 2011 at 4:22 pm

    Using perl to list files in a directoryhttp://forums.devshed.com/perl-programming-6/using-perl-to-list-files-in-a-directory-344889.html

    http://uk.answers.yahoo.com/question/index?qid=20090618014231AAoVEfp

    http://perl.about.com/od/filesystem/qt/perlglob.htm

    How do I list the files in a directory?
    http://perlmeme.org/faqs/file_io/directory_listing.html

    Perl tutorial
    http://www.comp.leeds.ac.uk/Perl/start.html