Click to See Complete Forum and Search --> : Exclusive text compare?


Ming
03-31-2003, 04:47 PM
Hi...I have a task that I'm hoping Linux can do for me:

I have two text files containing lists of names: fileA and fileB.
The files contain one name per line.
FileB is a subset of fileA.

How do I make a new file of names that are exclusive to FileA?

Thanks for any hints

Ming.

error27
04-01-2003, 03:11 AM
sort fileA > fileA_sorted
sort fileB > fileB_sorted
diff fileA_sorted fileB_sorted > list_ugly
sed -e 's/^> //' list_ugly > list_nice

(Untested... but you get the basic idea)