Select by Size

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

Select by Size

Post by tiago » 04 Sep 2016 07:19

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: 583
Joined: 14 Feb 2011 21:41

Re: Select by Size

Post by tiago » 08 Sep 2016 12:23

Anyone able to provide an alternative for this?

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

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

Re: Select by Size

Post by SammaySarkar » 08 Sep 2016 13:35

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

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

Re: Select by Size

Post by TheQwerty » 08 Sep 2016 14:13

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: 583
Joined: 14 Feb 2011 21:41

Re: Select by Size

Post by tiago » 09 Sep 2016 10:21

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: 8304
Joined: 06 Feb 2011 00:33

Re: Select by Size

Post by highend » 09 Sep 2016 10:48

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 or highend (at) web (dot) de

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

Re: Select by Size

Post by tiago » 09 Sep 2016 11:22

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: 8304
Joined: 06 Feb 2011 00:33

Re: Select by Size

Post by highend » 09 Sep 2016 11:28

And you have items selected in the active pane?
One of my scripts helped you out? Please donate via Paypal or highend (at) web (dot) de

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

Re: Select by Size

Post by tiago » 09 Sep 2016 12:44

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

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

Re: Select by Size

Post by highend » 09 Sep 2016 12:47

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 or highend (at) web (dot) de

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

Re: Select by Size

Post by tiago » 28 Sep 2016 07:53

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