Files Count on List

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
TedL1972
Posts: 64
Joined: 15 Nov 2018 18:49

Files Count on List

Post by TedL1972 »

Hello,

I posted this in "Wishes" but I realized it might have been the wrong place so I am posting it here as it appears more appropriate.

In short I would like to know if there is a way to show in a single column within a TAB list ONLY the number of files or documents contained in every folder and subfolder in a directory.

There is already a feature that does this in part:

Tools|Configuration|General|Tree and List|Show item count with folder size.

What I am asking is whether "Show item count" can be separated to show on its own column. In other words I would like to be able to show the number of documents in each folder and subfolder without the "folder size" as the latter sometimes takes some time to show up.

Can anyone advise if this feature already exists or a simple script to make it possible?

Thank you.

jupe
Posts: 3292
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Files Count on List

Post by jupe »

Create a new custom column, and use this variable <prop #ItemCount> unlike the inbuilt column values though, it isn't recursive, if you needed it to be, you can use alternate scripting methods, eg foldersize()

https://www.xyplorer.com/release_13.90. ... bleColumns

TedL1972
Posts: 64
Joined: 15 Nov 2018 18:49

Re: Files Count on List

Post by TedL1972 »

I tried to make a custom column with the script line you suggested but I must be doing something wrong.

Could you please list some of the key steps as there are several variables to chose from and I I got a bit lost.

If by recursive you mean that I would want for the number of files to show up all the time yes that's the case
exactly like for instance the "Size" column which shows the exact size of a document so I would like the script
to show the exact number of documents contained in a folder.

Thank you very much.

jupe
Posts: 3292
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Files Count on List

Post by jupe »

That's not what I meant by recursive, anyway if you are happy with the totals in the inbuilt column, then this will display the same:

return eval(foldersize(<cc_item>, "<d>+<f>"));

If you only want the count of files then use this instead:

return foldersize(<cc_item>, "<f>");

TedL1972
Posts: 64
Joined: 15 Nov 2018 18:49

Re: Files Count on List

Post by TedL1972 »

Worked perfectly, thank you!!!!!

:appl:

Online
sasumner
Posts: 26
Joined: 12 Mar 2015 12:21

Re: Files Count on List

Post by sasumner »

The short scripts by Jupe are cool; they work, I like them.

I'd like to always have such columns enabled, but I find when switching to the root of a drive with a lot of files, it takes a long time to calculate the data, resulting in a UI delay.

I understand this (it has a lot of work to do), but I'm thinking about lengthening these scripts such that it doesn't do all that work for the root folder, or maybe if it finds more than, say 500 files, it stops and just shows "500+" in the column.

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

Re: Files Count on List

Post by highend »

Then prepend something like if regexmatches(<cc_path>, ":\\$") { return "--"; } in front of it?
One of my scripts helped you out? Please donate via Paypal

Post Reply