[Solved] Find files with a comment NOT starting with "http"

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

[Solved] Find files with a comment NOT starting with "http"

Post 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

Code: Select all

C:\Docs\?:cmt:http*
gives all the items whose comment starts with "http", I thought that simply prepending a "!", like this

Code: Select all

C:\Docs\?:cmt:!http*
would have done the trick, but it didn't.
What am I missing?
Last edited by Marco on 10 Nov 2013 19:09, edited 1 time in total.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Find files with a comment NOT starting with "http"

Post by LittleBiG »

Try this:

Code: Select all

?:!cmt:http*

admin
Site Admin
Posts: 67224
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Find files with a comment NOT starting with "http"

Post 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.

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Find files with a comment NOT starting with "http"

Post by Marco »

It kinda works, but it finds also non-commented items. I'd like to find only commented items, something like

Code: Select all

C:\Docs\?:cmt:?* NOT cmt:http*
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

Code: Select all

C:\Docs\?:cmt:?* AND !cmt:http*
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Find files with a comment NOT starting with "http"

Post by Marco »

Solved, it's

Code: Select all

C:\Docs\?cmt::?* AND !"http*"
Notice the double ":".
Last edited by Marco on 10 Nov 2013 19:08, edited 1 time in total.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 67224
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Find files with a comment NOT starting with "http"

Post 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...

admin
Site Admin
Posts: 67224
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Find files with a comment NOT starting with "http"

Post by admin »

Marco wrote:Solved, it's

Code: Select all

C:\Docs\?cmt::?* AND !"http*"
Notice the double ":".
OH, right, this works well! :appl:

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Find files with a comment NOT starting with "http"

Post 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.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 67224
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: [Solved] Find files with a comment NOT starting with "ht

Post 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.

admin
Site Admin
Posts: 67224
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: [Solved] Find files with a comment NOT starting with "ht

Post by admin »

BTW, this works as well:

Code: Select all

?cmt::!("" or "http*")

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: [Solved] Find files with a comment NOT starting with "ht

Post by Marco »

admin wrote:BTW, this works as well:

Code: Select all

?cmt::!("" or "http*")
Cool, thanks!
Just to clarify, I see that

Code: Select all

?cmt::!("" or "http*")
searches only inside tag.dat, while

Code: Select all

?cmt:!("" or "http*")
does not. In the Help the double colon is the inline Boolean search marker (pag. 219). Are the two things related?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 67224
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: [Solved] Find files with a comment NOT starting with "ht

Post 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. :)

Post Reply