try this

sort -u < file1 |cut -f1 > file1.1
sort -u < file2 |cut -f1 > file2.1

comm -3 file1.1 file2.1

this should produce a list of isbns that are in one file but not the other.

On Thu, Mar 20, 2008 at 11:25 AM, Rob Hudson <[EMAIL PROTECTED]> wrote:
> I need some unix tool magic again.  Here's what I have and my goal...
>
>  I have 2 files.
>
>  File 1 contains a list of books by ISBN and some related data of the form:
>  ISBN, Price, Publisher, etc.
>
>  File 2 contains a list of books by ISBN and different related data of the 
> form:
>  ISBN, Quantity on hand, etc.
>
>  File 1 and File 2 should contain the same exact ISBNs but they
>  apparently don't -- their line number counts differ.
>
>  We want to find out which one contains ISBNs the other doesn't.  For
>  example, if file 1 is larger by 20 lines, what ISBNs are in file 1
>  that aren't in file 2?
>
>  I suspect it's a matter of: cut, sort, uniq or diff but I'm not that
>  familiar with these tools.  Any tips?
>
>  Thanks,
>  Rob
>  _______________________________________________
>  EUGLUG mailing list
>  [email protected]
>  http://www.euglug.org/mailman/listinfo/euglug
>
_______________________________________________
EUGLUG mailing list
[email protected]
http://www.euglug.org/mailman/listinfo/euglug

Reply via email to