Feature request: easy to implement combine --unique --count to compute number unique of items
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 ?
Hmmm... I seem to recall that --count-only overrides --unique, but maybe it shouldn't.
Lemme mull on that... :-)
This will requires some internal re-design. Mulling again.
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.
Still mulling, didn't make it to the 0.2.24 release :-(
ok maybe the next one ?
up
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.
Fixed in release 0.3.7