Intersection (AND)

Intersection (AND)

Description

Create the intersection (AND) of two or more sets.

Each line in the input text files is treated as an item. Items are case- and whitespace-sensitive. The order of items is not maintained.

Input files

  • at least 1 entries file (.txt)

Output files

  • Intersection (intersection.txt)

Context



Example

The following input files:

a.txt

John
Paul
George

b.txt

Paul
George
Ringo

...result in the following file:

intersection.txt

Paul
George

Source code

intersection.rb, intersection.yaml (GitHub)