App-Rak icon indicating copy to clipboard operation
App-Rak copied to clipboard

Feature request: easy to implement combine --unique --count to compute number unique of items

Open Zer0-Tolerance opened this issue 3 years ago • 7 comments

Hi Liz, it seems that in the latest version the --unique --count is not working as one would expect: rak "/./" file.txt --unique --count-only => should give the number of unique pattern but it only gives the count of non unique.

Or am I missing something ?

Zer0-Tolerance avatar Jan 24 '23 15:01 Zer0-Tolerance

Hmmm... I seem to recall that --count-only overrides --unique, but maybe it shouldn't.

Lemme mull on that... :-)

lizmat avatar Jan 24 '23 15:01 lizmat

This will requires some internal re-design. Mulling again.

lizmat avatar May 09 '24 11:05 lizmat

if one wants to get a count of unique values then you need to pipe it to an external command as sort -u if you use --count-only or wc -l if you use --unique ... it would really be better to have it in rak.

Zer0-Tolerance avatar May 10 '24 20:05 Zer0-Tolerance

Still mulling, didn't make it to the 0.2.24 release :-(

lizmat avatar May 13 '24 14:05 lizmat

ok maybe the next one ?

Zer0-Tolerance avatar May 20 '24 08:05 Zer0-Tolerance

up

Zer0-Tolerance avatar Jun 04 '24 21:06 Zer0-Tolerance

Finally getting back to this:

rak "/./" file.txt

would produce a match for each line, as /./ is a regex, and interpreted as a Bool. Is that what you expected? Or did you expect these semantics:

rak '{ ~$/ if /./ }' file.txt

which would match with the first character of each line.

lizmat avatar Jul 29 '24 11:07 lizmat

Fixed in release 0.3.7

lizmat avatar Aug 18 '24 13:08 lizmat