There is a file1
and another file file2
, then my solution to get the union file of file1
and file2
is:
step: get the intersection set file
comm -1 -2 file1 file2 >>intersectionFile
step: get the complement set file of
file1
comm -1 -3 file1 file2 >> file1ComplementFile
step: get the complement set file of
file2
comm -2 -3 file1 file2 >> file2ComplementFile
step: get the union set file equals the intersection set file PLUS
file1
's complement set file PLUSfile2
's complement set filecat intersectionFile file1ComplementFile file2ComplementFile >> unionFile
MY QUESTION IS is there a better OR easier way to get the union file of file1
and file2
?