Bob Mitchell

bob-o-rama: The Art of Slack.

Sets

Online set or list operations tool

2nd June 2009 - 22:57 - bob

This is a online, browser-based tool that implements set operations such as union, intersect, difference on lists of things. It is implemented in Javascript.

Scratch an itch. Right?

I wanted an easy way to take a list of email addresses, de-duplicate them and remove any other names that appear on another list.

This could have been done in several tools (I used a combination of Excel and the GNU utility comm (although it was probably possible to do it all in the spreadsheet), but I wanted a single-use tool that I could pass to other people that was simple, quick enough and I could make changes to.

It could probably be used for other things, but I can't think of any right now.

So, paste a list (newline separated) into A and B (lists can be empty), pick your operator and press the button.

Recommend disabling the spell check feature of the boxes (in Firefox this is right-click and un-check 'Check Spelling') as it will slow things down.

Works on a few thousand rows, but gets slower after that.

input A

input B


convert all commas to newline to create sets
preserve case
trim leading or trailing whitespace
output

  • sort - will sort A
  • unique - will determine sorted unique (de-duped) values in A
  • union - will merge A and B (sorted unique)
  • intersect - will show only elements in common between A and B (sorted unique)
  • difference A-B - will subtract B from A (sorted unique)
  • difference B-A - will subtract A from B (sorted unique)
  • preserve case - will not lower input prior to operation

Your data is safe - all the operations are performed in the browser on your PC - nothing is sent to me or anyone else. (other to let me know that you've seen this page).

Um, there should also be a disclaimer here, something along the line that you use the tool at your own risk and I will not be held responsible if something bad happens. If you have a problem with this then don't use it.

Like everything on this site (other than your comments) I assert my rights of ownership and claim Copyright on it.

I'm well aware that the algorithms are sub-standard and it could be much faster with a little tweaking, but it's good enough for now.

Let me know if you use it (and what you use it for).

Comments

Add your comment:

Your name:

Your comments:

* if your comment doesn't appear instantly, don't worry - it probably hit the spam filter and need to be moderated before it will show-up.