ItemCount + Folder Exclusion

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

ItemCount + Folder Exclusion

Post by armsys »

Is it impossible to hunt all folders with one (1) item but the respective path can't contain the "magazine" word (wildcard) anywhere?
Something like that: prop:#itemcount: 1 AND !(*\*magazine*\*)

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: ItemCount + Folder Exclusion

Post by armsys »

Hello! Anybody home?

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

Re: ItemCount + Folder Exclusion

Post by admin »

Your search term is wrong, but it would not work even if it would be right. Bugs... :bug: ... I'm working it out right now...

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

Re: ItemCount + Folder Exclusion

Post by admin »

Next beta you do this:

Code: Select all

prop:#itemcount: 1 AND !path: magazine
Or better in this sequence -- likely to run faster since only items with path != magazine are content-counted (Boolean AND-optimization):

Code: Select all

path: != magazine AND prop:#itemcount: 1
This works the same:

Code: Select all

path: !magazine AND prop:#itemcount: 1

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: ItemCount + Folder Exclusion

Post by armsys »

admin wrote:Your search term is wrong, but it would not work even if it would be right. Bugs... :bug: ... I'm working it out right now...
What a charming paradox!
admin wrote:Next beta you do this:
Or better in this sequence -- likely to run faster since only items with path != magazine are content-counted (Boolean AND-optimization)...
Stunning! Awesome! Faster than my typing.
I like you more than Captain America! Thanks Don! :beer: :cup: :appl:

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

Re: ItemCount + Folder Exclusion

Post by admin »

armsys wrote:I like you more than Captain America! Thanks Don! :beer: :cup: :appl:
Just give me money, and it's okay. :biggrin:

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: ItemCount + Folder Exclusion

Post by armsys »

An innocuous typo is accidentally discovered:
Original
//all items with folder "saturn" anywhere in the path

Perhaps Don's intended meaning:
//all items with folder "saturn" NOT anywhere in the path
To see the attached files, you need to log into the forum.

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: ItemCount + Folder Exclusion

Post by armsys »

Thanks for adding a time-saving Find Files feature. :appl:

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

Re: ItemCount + Folder Exclusion

Post by admin »

armsys wrote: Perhaps Don's intended meaning:
//all items with folder "saturn" NOT anywhere in the path
Absolutely, I will fix it right now, thanks!

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: ItemCount + Folder Exclusion

Post by armsys »

The following Find Files line (pattern) works fine:
*.txt & path: != \\fitness\\ & path: != \\assorted\\ & path: != \\$RECYCLE.BIN\\

Question:
How to combine \\fitness\\, \\assorted\\ and \\$RECYCLE.BIN\\?
Something like: path: != (\\fitness\\ | \\assorted\\ | \\$RECYCLE.BIN\\)

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

Re: ItemCount + Folder Exclusion

Post by admin »

Code: Select all

!(path:mars OR saturn OR merkur)

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: ItemCount + Folder Exclusion

Post by armsys »

Yes, it works robustly as expected.

Code: Select all

*.txt & !(path:fitness OR assorted OR $RECYCLE.BIN)
I didn't know the syntax is possible. Thanks Don.

Edit (2015.09.15 Tue 03:10:27 PM HKT)
Applying Don's above-mentioned optimization, I "optimize" the pattern as follows:

Code: Select all

!(path:fitness OR assorted OR $RECYCLE.BIN) & *.txt
Thanks Don.
Last edited by armsys on 15 Sep 2015 09:11, edited 1 time in total.

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: ItemCount + Folder Exclusion

Post by armsys »

Houston, I have a problem!
Why would XY interpret the following 2 patterns differently?
!(path:planet | css) & *.epub
*.epub & !(path:planet | css)
Always the former fails (no items found) but the latter succeeds. But why?

I do set FindAllowMasterInvert=0.
It seems the negation (!) effect is still distributed and propagated throughout the entire pattern!

XY version: v15.70.0119

highend
Posts: 14993
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: ItemCount + Folder Exclusion

Post by highend »

One of my scripts helped you out? Please donate via Paypal

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

Re: ItemCount + Folder Exclusion

Post by admin »

Tip: it's the "path:" prefix that is propagated...

Post Reply