I have 4 files and would like to know elements which are non overlapping (per file) compared to the elements in other files.
File A
Vincy
ruby
rome
File B
Vincy
rome
Peter
File C
Vincy
Paul
alex
File D
Vincy
rocky
Willy
Any suggestion for one liner in perl, python, shell, bash. The expected output is:
File A: ruby, File B: Peter, File C: Paul, Alex File D: rocky, Willy.
Edit after question clarified: Unique elements across all files, and the file in which it occurs:
Edit:
perly way of doing it, will be faster if the files are large:
execute as:
myscript.pl filea fileb filec … filezz
stuff from before clarification:
Easy enough with shell commands. Non repeating elements across all files
Unique elements across all files
Unique elements per file
(edit thanks to @Dennis Williamson)