Page 1 of 1

Select by Size

Posted: 04 Sep 2016 07:19
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.

Re: Select by Size

Posted: 08 Sep 2016 12:23
by tiago
Anyone able to provide an alternative for this?

'show folder sizes' can/must be temporally on for this.

Re: Select by Size

Posted: 08 Sep 2016 13:35
by bdeshi
how exactly is select by size supposed to work?

Re: Select by Size

Posted: 08 Sep 2016 14:13
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.

Re: Select by Size

Posted: 09 Sep 2016 10:21
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.

Re: Select by Size

Posted: 09 Sep 2016 10:48
by highend
And what files do you have in the inactive pane? The Qwerty's script works fine here...

Re: Select by Size

Posted: 09 Sep 2016 11:22
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.

Re: Select by Size

Posted: 09 Sep 2016 11:28
by highend
And you have items selected in the active pane?

Re: Select by Size

Posted: 09 Sep 2016 12:44
by tiago
yes.
tried everything: all, some, none, messing with the code, stepping.
v 17.00.

Re: Select by Size

Posted: 09 Sep 2016 12:47
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

Re: Select by Size

Posted: 28 Sep 2016 07:53
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.