Alexis Rondeau

Newsfeed

Repository · Friday, October 9, 2015 · 03:58

set-stuff

A quick throw-away utility to compare two sets of numbers from two files

Clojure

Get the intersection of the contents of two files

I quickly needed to get the intersection of the contents of two files. It took me, including lein and emacs setup, all of 5 minutes to come to a simple solution. No variables, no loops, all standard functions.

Usage

user> (in-ns 'set-stuff.core)
set-stuff.core> (intersection-files "my-ids.txt" "found-ids.txt")

;; => #{7756496 2997031 5379724 7857667 4182588 3375641 72489 117220 5998390 4698999}