Difference

Difference

Description

Create the difference of two sets A and B (set A – set B).

Each line in the input text files is treated as an item. Items are case- and whitespace-sensitive. If more than one input file is specified for A or B, their entries are unified first. The order of items is not maintained.

Input files

  • at least 1 set A file (.txt)
  • at least 1 set B file (.txt)

Output files

  • Difference (difference.txt)

Context



Example

The following input files:

a.txt

John
Paul
George
Ringo

b.txt

John
George

...result in the following difference:

difference.txt

Paul
Ringo

Source code

difference.rb, difference.yaml (GitHub)