In case when I don't have time to wait for the Windows
"quick" (even with Indexing service started) search program
and SQL engine is too much efford, here is my solution:
# my 'music' directory contains over 5000 files
# so the fastest way to be listed:
D:\tree /f /a .\music > \music_list.txt
# later the following script is 'move'd to
# %systemroot%\system32
### begin
use strict;
my $argv = join '.*', @ARGV;
my $song = qr/\|(?!\+\S{3})(\s.*?)$argv/i;
my $clean = qr/^\W+(.+?)\W+$/;
my $file = 'd:\music_list.txt';
my $album = q::;
open my $fh, $file
or die "cannot open $file: $!$/";
while(<$fh>){
/(\\|\+)-{3}/
and $album = $_
and next;
if (/$song/) {
s/$clean/$1/ for $_, $album;
$album
? print "album: $album$/","song: $_$/$/"
: print "album: . $/","song: $_$/$/";
$main::counter++;
}
}
print "$/total: $main::counter song(s) found$/"
if $main::counter;
__END__
### end
# finally
D:\copy ffind.pl %systemroot%\system32
D:\ffind.pl compare
album: Good music
song: Sinead O'Connor - Nothing Compares 2 U.mp3
album: party
song: Sinead O'Conner - Nothing Compares To You.mp3
total: 2 song(s) found
That's all.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.