Searching for (1) file

I'm trying to do a spotlight search for certain files named "DSC0xxxx (1).JPG" that I want to delete. When I type "(1)" in the search field all files with the number 1 come up. It's as though the parenthesis are ignored.

Is there something with parenthesis that makes them invisible.

I have thousands of files with the (1). It would be nearly impossible to locate and delete them one by one.

MBP 2.4, Mac OS X (10.5.2)

Posted on Feb 16, 2009 5:03 PM

Reply
10 replies

Feb 18, 2009 12:41 PM in response to V.K.

This all sounds a bit odd to me. I had six jpegs with really strange names "paradise.12.b.1.jpg" which I changed to remove the "dots" to this: paradise12b(1).jpg. I then backed up to the parent folder (the lot of them are buried rather deep):

/Volumes/Data/Visuals/OldVisuals/2006/Summer06/blakeimages/paradise12b(1).jpg

With the Visuals folder open, I hit Command-Shift-F to bring up a "Find by Name contains" search window, clicked the "Visuals" as the place to search (arghhh! WHEN will the idiocy of "This Mac" being the default ever get fixed???), typed in:

(1)

And immediately got all six files listed, and ONLY those six files. No quotes necessary, no Raw Query. It just works. BTW, if I just type plain 1, there are more than 10,000 items with a one in their name in the sub-folders of Visuals. Even just typing (1 will work to bring up the six files, and only those files.
Francine

User uploaded file
Francine
Schwieder

Feb 18, 2009 9:04 AM in response to Dennis Quant

It may be that you are looking for part of a file name. When I tested it, I put the entire file name in parenthesis and an identical one without the parenthesis and found both without the quotes but only the parenthetical one when using quotes.
However, you are looking for a (1) in part of the file name. That might be a limitation in the simple search.
I just searched for a file using part of the file name and nothing showed up.

You can probably use a "raw query" to find the files. Search for "raw query" and spotlight.
Apple also provides some good information, although well-hidden, here:
http://developer.apple.com/macosx/spotlight.html
It's a finder/spotlight option that has very little information but it makes the spotlight search very powerful.

There is also the "find" command in the terminal which can find anything.

Message was edited by: Fritz

Message was edited by: nerowolfe

Message was edited by: Archie

Feb 16, 2009 5:14 PM in response to Dennis Quant

Dennis Quant wrote:
I'm trying to do a spotlight search for certain files named "DSC0xxxx (1).JPG" that I want to delete. When I type "(1)" in the search field all files with the number 1 come up. It's as though the parenthesis are ignored.

Is there something with parenthesis that makes them invisible.

No, but they are ignored unless you escape them with quotes as follows:
In the search box enter
"(1)"
and see if that helps.

Feb 18, 2009 12:52 PM in response to Francine Schwieder

Francine,
as I understood the original poster he specifically wanted to search ONLY for files with the names of the form DSC0xxxx(1).JPG (where xxx is any string of characters)and not all files with (1) in their file names. I don't know of any way to do that exact kind of search without using raw query.

Of course it would probably work just as well to search for files with both (1) and DSC0 in their file names but formally speaking that would not be the same thing.

that kind of search certainly needs no raw query, you are quite right about that.

Apr 10, 2009 11:31 PM in response to Dennis Quant

I came here with a similar issue. Many files with (xx) don't show up under xx search or (xx) search with OS 10.5.6. Not sure if Tiger was any different.

From the advice of one of the folks in this thread (Francine Schwieder), I used "Raw Query" instead of "Kind" using the Finder search (not the Spotlight up in the corner). I assume this will work with msfind in the Terminal but haven't tried it.

What I found so far...
_kMDItemDisplayName == " ("_ This finds the first item only *within the folder* that I'm searching. That is, once it finds one item, it seemed to stop(?!). It didn't find the next match, just the one.

_kMDItemFSName == " ("_ Finds all that match, unlike above. Very promising. All items with "(" are found whereas kMDItemDisplayName returned the only the first item in the searched directory. Don't know why.

_kMDItemFSName == " (*B"_ This finds all matches, as above, if B is removed. But here, the letter B was within the last item in the directory. kMDItemDisplayName did not find this. Zero results. Nice that more than two wild-cards can be used!

Message was edited by: kerferfer for a more beautiful formatting

Apr 10, 2009 11:31 PM in response to kerferfer

kerferfer wrote:
From the advice of one of the folks in this thread (Francine Schwieder), I used "Raw Query" instead of "Kind" using the Finder search (not the Spotlight up in the corner). I assume this will work with msfind in the Terminal but haven't tried it.


It seems that these searches now work in Spotlight! Perhaps adding the "Raw Query" this one time has enabled my ability to find items that begin with "("... the reason I came here to begin with. Note: "Raw Query" now appears under kind since I added it by clicking on the check box from "Other..."

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.

Searching for (1) file

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