Sensitive case searching/spotlighting

Hi,

I'm using X.4.9 up-to-date on a Power Mac G4 Cube.

Imagine I have 8000 files that are duplicated (4000+4000)...

4000 have ".mp3" extension in their file names. The other 4000 have ".MP3" extension in their file names.

Now how do I tell "Spotlight" to only seek/hunt the files that have ".MP3" (without quotes) characters in their file names?

I want to select these files and trash them so I get rid of duplicates.

Thanks all in advance,

JoMel

Power Mac G4 Cube DP 1.7GHz + 7V Zalman base fan, Mac OS X (10.4.9)

Posted on May 30, 2007 1:21 AM

5 replies

May 31, 2007 1:22 AM in response to Community User

Using the Raw Query should do it. Anyway, this worked for me to find only .jpg, and then tried .JPG and it found different files in the same parent folder.

So go to the folder you want to search and hit Command-f to bring up a Find window. Click on a default criterion to bring up the drop down menu, and select Other. From the Other menu select Raw Query. In the Raw Query field paste in this:

(kMDItemFSName == "*.MP3")

This says "Look for items whose file system name contains anything with the extension of MP3"--Raw Query searches like this are always case sensitive unless you add an option to NOT be.
Francine

User uploaded file
Francine
Schwieder

May 31, 2007 11:58 AM in response to Daniel Marr

He has some number of mp3 files that are identical, except one batch ends with the extension ".mp3" and the other batch with ".MP3"--thus he has "song.mp3" and "song.MP3" and "anothersong.mp3" and "anothersong.MP3"--he wants to find and trash all the dupes that end in the ".MP3" extension. The default behavior of the regular "Name Contains" search is to be case INsensitive, so no matter what you used in the name field, whether mp3 or MP3, the result list would contain both extensions, it doesn't discriminate between upper case and lower case.

If you do a Name Contains search, lets say you use "jpeg"--it will return a file named "JPEG28***" as valid result, even though the search term is lower case and the result is uppercase. If you save the search and you use Property List Editor to open the so-called Smart Folder, you can see what it REALLY does:

(kMDItemDisplayName = ' jpeg'cd) && (kMDItemContentType != com.apple.mail.emlx) && (kMDItemContentType != public.vcard)

It searches for "jpeg" and is case insensitive (the added "c" option) and also insensitive to diacritical marks (the "d"), plus it ignores email and vcards. This the default behavior. The only way to avoid this is to explicitly use the Raw Query yourself, and not add the "c" or "d" option.
Francine

User uploaded file
Francine
Schwieder

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Sensitive case searching/spotlighting

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.