Glam Prestige Journal

Bright entertainment trends with youth appeal.

I have two text files that each have two space separated columns .

File 1:

Mary 123
Jack 836
Joan 936

File 2:

Mary 123
Jack 837
Henry 430

What I'm looking for is to find names unique to both files as well as names common to both files but with a different value .

Output

  • Jack: Common to both files but different value (836,837)
  • Joan: Unique to File1
  • Henry: Unique to File2

How do I do this using unix commands?

One thing I came across is to use comm command to find unique names and then use the diff command to find common names with different values. But is there a more efficient way to do this ?

3 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy