Computing.Net > Forums > Unix > Two files showing mismatch in awk ?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Two files showing mismatch in awk ?

Reply to Message Icon

Name: raptor3624
Date: April 2, 2007 at 06:51:14 Pacific
OS: Win
CPU/Ram: 2 GB RAM
Product: AMD Turion
Comment:

I have two files ,file 1 and file 2, with lots of numbers.
File 1:
*******
7251
7298
7302
7248
7154
7159
7304

File 2:
*******
7266
7224
7224
7252
7230
7224
7296

I need to cat the two files in awk,sort both the files and bring out the unique numbers between the two.That is,any row with a count not equal to a number in the two files would be shown as a mismatch.How do I achieve this?The numbers run thousands.



Sponsored Link
Ads by Google

Response Number 1
Name: drawkwag
Date: April 2, 2007 at 10:41:33 Pacific
Reply:

My awk knowledge is about nil. If you don't have to use awk then how about this?

sort -un file1 > tmp
sort -un file2 >> tmp
uniq -d tmp



0
Reply to Message Icon

Related Posts

See More


How to conver a text file... GAWK variable problem



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Two files showing mismatch in awk ?

trouble merging two files with awk www.computing.net/answers/unix/trouble-merging-two-files-with-awk/7937.html

awk with two files www.computing.net/answers/unix/awk-with-two-files/7922.html

comparing two files www.computing.net/answers/unix/comparing-two-files/8256.html