Live Chat!

Uniq and basic set theory

* * * * * 1 votos

October 25th, 2006 toydi

Imagine that I have two files:
aquatic - contains a list of aquatic animals
starfish
whale
nemo
crab
dolphin
mammal - contains a list of mammals
whale
RMS
batman
dolphin
scooby-doo
Given aquatic and mammal are two different sets, let’s use sort and uniq to play with a few basic set theory operations:
Union ( A U B - members in either A or B )
aquatic U mamal= {batman, [...]

Posted in Text Manipulation, sort, uniq | Hits: 6372 | 1 Comment »