what about comm? or am I missing something. Of course if file1 needs transforming use perl or whatever filter

# comm -12 <(sort file1) <(sort file2) > dups.out

the 'cmd <(cmd1 ...) ...' notation if not supported by your shell means the two-step process 'cmd ... > temp1; cmd1 temp1' cmd1 being a "filter".

or in other "words" ;)

% stephan@armen (/home/stephan) % % cat dat1 3 110582 SFCA 4158675309 041414041421 3 060784 NYNY 2125552368 190159204657 3 121906 RANC 9195551234 123401123620 % stephan@armen (/home/stephan) % % cat dat2 3 110582 SFCB 2258675309 041414041421 3 110582 SFCA 4158675309 041414041421 % stephan@armen (/home/stephan) % % sort dat1 > dat1.sorted % stephan@armen (/home/stephan) % % sort dat2 > dat2.sorted % stephan@armen (/home/stephan) % % comm -12 dat1.sorted dat2.sorted 3 110582 SFCA 4158675309 041414041421
hth --stephan, just another unix hacker,

In reply to Re^2: File Handling for Duplicate Records by sgt
in thread File Handling for Duplicate Records by sheasbys

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.