[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Suggestion of new program: execute mathematical set operations on lists



Well, I had once programmed a tool like this called mset (multiset)
and it is still on my hard disk though releasing it would require some
kind of testing and quality assurance (I call the package leutils).
First of all the xchroot package I have just released would need to
get accepted before I can go on publishing and packaging more of my
software stock.
For the meanwhile you can use the following programs:
sort -u, comm, join, uniq, column, paste, colrm, etc.
which do almost provide an equivalent functionality if you use them in
the right way:
comm: set difference, intersection, union, delta
sort -u: set union, etc.

Elmar Stellnberger


2013/10/30, Frank Stähr <der-storch-85@gmx.net>:
> Hello everybody,
>
> I am not yet looking for a sponsor, but going to program a tiny tool.
> Because I am unexperienced and don’t want to do all the work for
> nothing, first of all:
>
> Is this tool senseful, is there a certain need for it? I am very
> interested in your opinions, hoping that this list is the right place
> for that.
>
>
> And here it is: setop takes as inputs several lists/sets, calculates
> desired (mathematical) set operations on them and outputs the final set
> (or depending on operation resulting number of elements, answer yes/no,
> …).
>
> For example: File A contains 3 3 2 5 1 (each number an extra line). Then
> setop A
> would result in 1 2 3 5. This is equivalent to
> sort | uniq
>
> With a file B containing 5 90 2 7 the command
> setop -i A B
> would yield 2 5.
>
> Here, -i stands for intersection. Of course, there is no limitation to
> numbers, elements can be any non-empty strings.
>
> Other operations are union, symmetric difference, difference, contains
> element, is subset, cardinality and so on. As you can see on
> <http://www.catonmat.net/blog/set-operations-in-unix-shell-simplified/>
> nearly all these operations can already be done with other tools, but
> the according command lines are mostly very tortuous. There doesn’t seem
> to be a tool that directly works with sets.
>
> I even exactly know what options setop (name ok?) should have and what
> it can do (how it is used), but am waiting for some responses from you
> before programming.
>
> I would be very grateful for your feedback,
> Frank
>
>
> --
> To UNSUBSCRIBE, email to debian-mentors-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
> Archive: [🔎] 1383147779.1944.30.camel@storch-desktop">http://lists.debian.org/[🔎] 1383147779.1944.30.camel@storch-desktop
>
>


Reply to: