Item count custom column with pattern match

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Millzey
Posts: 169
Joined: 07 Oct 2011 15:10

Item count custom column with pattern match

Post by Millzey »

If there an efficient way to list the item count of say 500 folders (less than 20 files in each) in a custom column with a pattern match or exclusion with the current functions? I dont know if report/folderreport would be the proper choice, but I'd like to have a column that didnt rely upon populating a tag that showed a count of only files that matched or excluded a particular pattern. I was hoping the Ghost Filter applied to the item count of the size column or the foldersize function but it doesnt

Millzey
Posts: 169
Joined: 07 Oct 2011 15:10

Re: Item count custom column with pattern match

Post by Millzey »

Ok I found listfolder function and is has a pattern parameter, in figured it'd be the most efficient, but does it support multiple patterns? I'd like to filter all *.mp3 and *.flac for example for an item count column. Will I have to use 2 listfolder calls and combine the count?

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

Re: Item count custom column with pattern match

Post by highend »

If there are no subfolders involved,

Code: Select all

return listfolder(<cc_item>, "*.mp3", 1 + 32) + listfolder(<cc_item>, "*.flac", 1 + 32);
or

Code: Select all

return gettoken(quicksearch("*.mp3 OR *.flac", <cc_item>), "count", <crlf>);
You need to test yourself, which version is faster...
One of my scripts helped you out? Please donate via Paypal

Millzey
Posts: 169
Joined: 07 Oct 2011 15:10

Re: Item count custom column with pattern match

Post by Millzey »

Thank you very much

Post Reply