Select by Size

Features wanted...
Post Reply
tiago
Posts: 589
Joined: 14 Feb 2011 21:41

Select by Size

Post by tiago »

Suggestion for 'Sync Select...' feature: select by size.
Much, much needed for quick comparison for massive folder duplicates at once and further easy deletion.
Thanks.
Power-hungry user!!!

tiago
Posts: 589
Joined: 14 Feb 2011 21:41

Re: Select by Size

Post by tiago »

Anyone able to provide an alternative for this?

'show folder sizes' can/must be temporally on for this.
Power-hungry user!!!

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Select by Size

Post by bdeshi »

how exactly is select by size supposed to work?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Select by Size

Post by TheQwerty »

Code: Select all

"Sync Select Size"
  $sizes = FormatList(Report('{Size};', 1), 'dents', ';');
  Focus 'PI';
  SelFilter($sizes,, 'Size');
This will get the sizes of the selected items, switch panes, and then select any items displaying the same sizes.
Note though that SelFilter is checking the displayed sizes which means:
1) Both panes need to use the same format to get a match.
2) Due to rounding and converting between different units there is a chance it will not be 100% accurate - switching to 'Bytes' or 'Raw' in both panes can work around this.

Another option would be to perform the comparison within the script like so:

Code: Select all

"Sync Select Size 2"
  $sizes = Report("{Size RAW};*<crlf>", 1);
  $sizes = FormatList($sizes, 'dents', <crlf>);

  $ip = ListPane('i', '*', 0, '|');
  $ipSizes = Report("{Size RAW};{FullName}<crlf>", $ip);
  
  $matches = FormatList($ipSizes, 'f', <crlf>, $sizes);
  $matches = RegexReplace($matches, '^\d+;');

  SelectItems $matches, '2', 1, 'n', 'i';
The second has the added advantage that you can expand it more easily to handle other matching cases - if you wanted to check Name and Size for instance or compare dates, etc.

tiago
Posts: 589
Joined: 14 Feb 2011 21:41

Re: Select by Size

Post by tiago »

Hello, TheQwerty. Many thanks for those.

I can't manage the second one to work...?

$ipSizes = Report("{Size RAW};{FullName}<crlf>", $ip);

The SIZEs are not being reported here for the listed items at $ip.
Power-hungry user!!!

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Select by Size

Post by highend »

And what files do you have in the inactive pane? The Qwerty's script works fine here...
One of my scripts helped you out? Please donate via Paypal

tiago
Posts: 589
Joined: 14 Feb 2011 21:41

Re: Select by Size

Post by tiago »

The same scheme that works with the first script, highend: a test pane at the same location as p1, sizes displayed in bytes, same columns. Thanks for joining in.
Power-hungry user!!!

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Select by Size

Post by highend »

And you have items selected in the active pane?
One of my scripts helped you out? Please donate via Paypal

tiago
Posts: 589
Joined: 14 Feb 2011 21:41

Re: Select by Size

Post by tiago »

yes.
tried everything: all, some, none, messing with the code, stepping.
v 17.00.
Power-hungry user!!!

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Select by Size

Post by highend »

Then show the output of the two steps:

Code: Select all

  $ip = ListPane('i', '*', 0, '|');
  $ipSizes = Report("{Size RAW};{FullName}<crlf>", $ip);
e.g. as a .gif animation
One of my scripts helped you out? Please donate via Paypal

tiago
Posts: 589
Joined: 14 Feb 2011 21:41

Re: Select by Size

Post by tiago »

ok. 17.20 is out so after upgrade i'll find software which could do the record. In hopes a small update is the reason for the glitch.
thank you.
Power-hungry user!!!

Post Reply