Page 1 of 1

Item count custom column with pattern match

Posted: 22 Oct 2017 06:29
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

Re: Item count custom column with pattern match

Posted: 22 Oct 2017 06:43
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?

Re: Item count custom column with pattern match

Posted: 22 Oct 2017 09:47
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...

Re: Item count custom column with pattern match

Posted: 01 Nov 2017 04:37
by Millzey
Thank you very much