Page 1 of 1
[Solved] Find files with a comment NOT starting with "http"
Posted: 10 Nov 2013 17:43
by Marco
As the title says, I'm trying to isolate all the items in a folder whose comment doesn't start with "http".
Since typing in the AB
gives all the items whose comment starts with "http", I thought that simply prepending a "!", like this
would have done the trick, but it didn't.
What am I missing?
Re: Find files with a comment NOT starting with "http"
Posted: 10 Nov 2013 18:47
by LittleBiG
Re: Find files with a comment NOT starting with "http"
Posted: 10 Nov 2013 18:56
by admin
This is an interesting problem. There are two ways to place the NOT:
a) Find files with a comment NOT starting with "http".
b) Find files NOT with a comment starting with "http".
You are looking for a) but XY currently gives you b) when you do ?:!cmt:http* or ?:cmt:!http* (both are internally treated the same).
I opted for b) since it will give you the inverted result list of a), which is what I expect of the NOT character.
Re: Find files with a comment NOT starting with "http"
Posted: 10 Nov 2013 18:57
by Marco
It kinda works, but it finds also non-commented items. I'd like to find only commented items, something like
EDIT: I see you replied, Don. Let me read what you wrote...
REPLY: yes Don, that's exactly what happens. Any chance I can tell XY to give me all the commented items and exclude from them those whose comment starts with http with a query like the one above? I know that I can resort to manually scanning tag.dat with regex or use intermediate tags, but I'd like to hear from the insider.
PS: maybe this makes more sense
Re: Find files with a comment NOT starting with "http"
Posted: 10 Nov 2013 19:07
by Marco
Solved, it's
Notice the double ":".
Re: Find files with a comment NOT starting with "http"
Posted: 10 Nov 2013 19:08
by admin
Yes, the latter works but it's not optimal performance-wise, especially when you search the whole system.
But there is a way. As I said before: ?:!cmt:http* or ?:cmt:!http* (both are internally treated the same) -- well, why not treat them differently! I think ?:cmt:!http* should do what you want. I will check if I can do that...
Re: Find files with a comment NOT starting with "http"
Posted: 10 Nov 2013 19:11
by admin
Marco wrote:Solved, it's
Notice the double ":".
OH, right, this works well!

Re: Find files with a comment NOT starting with "http"
Posted: 10 Nov 2013 19:15
by Marco
Btw
admin wrote:well, why not treat them differently!
Mmh maybe the current way is formally/logically correct and I was erroneously expecting something different. I'd rather keep it working as it does.
After all, LittleBiG's query correctly finds all items without a comment starting with "http" - and a non-existing comment doesn't start with "http".
My confusion arose from recalling that in the past tag searches where done only on items listed in tag.dat.
Re: [Solved] Find files with a comment NOT starting with "ht
Posted: 10 Nov 2013 19:25
by admin
Yes, I will not touch it. Because it is even more complex because looking for cmt: automatically restraints the results to tagged items:
?cmt:* will find all tagged items with or without a comment.
?cmt:!* will find all tagged items NOT (with or without a comment) i.e. it will never find anything.
This is how it is, and it is logically correct.
Re: [Solved] Find files with a comment NOT starting with "ht
Posted: 10 Nov 2013 19:41
by admin
Re: [Solved] Find files with a comment NOT starting with "ht
Posted: 10 Nov 2013 19:52
by Marco
admin wrote:BTW, this works as well:
Cool, thanks!
Just to clarify, I see that
searches only inside tag.dat, while
does not. In the Help the double colon
is the inline Boolean search marker (pag. 219). Are the two things related?
Re: [Solved] Find files with a comment NOT starting with "ht
Posted: 10 Nov 2013 20:14
by admin
The latter does not make much sense since it looks for a single string
("" or "http*") -- the Boolean maker : is missing.
The decision whether searches are only inside tag.dat or not is a rather complex piece of code. I cannot explain it in words now.
