This is a small JavaScript tool to compare two sets of data. Let's say you have two columns of data, and you want to quickly determine which values occur in the first column only, the second column only, or both columns. There are quite a few ways to do this, including variations of sort
and uniq
on the command-line, throwaway Ruby/Python/Perl scripts, etc. But if you already have a browser window open, this tool can do the same thing quickly and easily.
- Works offline (just clone or download this repository and open
index.html
in any browser) - Sorting not required: values retain their original order
- Online demo available
First enter some data in Col 1 and Col 2. Then click on one of the three buttons at the bottom of the page:
- Col 1 only (display values that occur only in Col 1)
- Col 2 only (display values that occur only in Col 2)
- Both cols (display values appearing in both Col 1 and Col 2)
The result will be displayed in the third column.
"Compare columns" is part of the tiny tools series.
Other tools for working with columns of data that might also be of interest:
- milligram CSS by @cjpatoilo, prototyped using dropin-minimal-css
- github-corners by @tholman
MIT.