Welcome to the Mythicsoft Q&A site for:

- Agent Ransack
- FileLocator Lite
- FileLocator Pro

Please feel free to ask any questions on these products or even answer other community member questions.

Useful Links:

- Contact Us
- Help Manuals
- Mythicsoft Home
0 votes

I would like to exclude certain file types for content searches, but include them for filename searches.

For example. I want to find files that are named cat or have cat in the contents, but I don't want to include any *.jpg files that might also happen to cat in the encoding by chance.

Let's say I have three files in a folder that are identical, except for their names. The file contains cat in the contents:

cat.jpg image1.jpg image2.jpeg 

Here's what I get trying various searches. All of them have include filename in contents option checked.

Search 1:

Containing text: cat
Results:  cat.jpg image1.jpg image2.jpeg

Search 2:

File name: NOT:*.jpg
Containing text: cat
Results:  image2.jpeg

Search 3:

File name: cat
Containing text: cat NOT:*.jpg
Results:  none

Search 4:

File name: cat NOT:*.jpg
Containing text: cat 
Results:  none

Search 5:

File name: NOT:*.jpg cat 
Containing text: cat 
Results:  cat.jpg image1.jpg image2.jpeg

What search can I do to get?

Results:  cat.jpg image2.jpeg

cat.jpg is included because 'cat' is in the filename even though it's an excluded file extension, and image2.jpeg is included because 'cat' is in the contents and it's not an excluded file extension

by (30 points)

1 Answer

0 votes

If I understand correctly you're looking to search through all files except .jpg (unless the .jpg contains the word cat in the name).

The only way I can think of doing that is with Boolean File name expressions. Change your File name expression type to Boolean and then try this:

File name:       cat OR NOT .jpg
Containing Text: cat
by (30.1k points)
I tried, but it didn't work. Even though Include Filename in Contents is checked, it still doesn't find any jpgs regardless of what they are named. I think I'll just have to do two searches, one for just filenames, the other for contents (and excluding images).
I might have misunderstood, can you provide a list of example file names that would or would not be found?
I edited my original question with what I've tried and the results I'm getting
Ok, I think I understand. Not sure which product you're using but I've updated the answer.
...