I'd like to know the total number of files in a directory tree that match any of of several wild-card patterns. So there is no doubt or obfuscation whatsoever, what I am trying to do is to count the number of .mp3 and .wma files in a directory tree. Specifically,
doesn't work.
Now the result of the command with just ".mp3" is 3454, with just ".wma" is 26, so I would expect the result of the above to be 3480. However, the result of the above is just 26, and if I reverse the "*.mp3" and "*.wma" the result is just 3454, what you would expect given that the immediately previous doesn't work.
And, oddly enough,
gives 817(????).
Now I am perfectly aware that:
will get the job done. But it also takes significantly (and therefore noticeably longer) than looking for just one file type, presumably because it is scanning the directory tree twice. (And since I will be ultimately looking for 4 file extensions, 4 times longer.)
Certainly not the end of the world; and it is admittedly a somewhat academic question in that there is a workable (and not very complicated) solution. However, I'd still like to know why what I thought would work does not work on general principles alone.
Code:
Echo %@Files[/S D:\Multi-Media\Music\Sources\*.mp3;*.wma]
Now the result of the command with just ".mp3" is 3454, with just ".wma" is 26, so I would expect the result of the above to be 3480. However, the result of the above is just 26, and if I reverse the "*.mp3" and "*.wma" the result is just 3454, what you would expect given that the immediately previous doesn't work.
And, oddly enough,
Code:
Echo %@Files[/S D:\Multi-Media\Music\Sources\*.mp3 D:\Multi-Media\Music\Sources\*.wma]
Now I am perfectly aware that:
Code:
Echo %@Eval[%@Files[/S D:\Multi-Media\Music\Sources\*.mp3]+%@Files[/S D:\Multi-Media\Music\Sources\*.wma]]
Certainly not the end of the world; and it is admittedly a somewhat academic question in that there is a workable (and not very complicated) solution. However, I'd still like to know why what I thought would work does not work on general principles alone.