Hello,

I'm having a problem sorting between two files that I hope someone can help me with as I'm still pretty new to Perl.

I need to separate all values where key 1 first page third column is != key 2 second page third column and then print those lines to another external page sequentially from the two.

The trick is that the file has 90k+ entries and line 1 may have duplicates such as 'Scott' more than once which I would like to keep, only eliminating those values where 'Scott' shows in line key 1 & 2 of the same second column value.

A sample of the first file looks like this:

The second file looks like this:

My desired results would be this:

I've been through many pages of @array, %hash and awk trying to modify it to suit my needs but have not been able to get a working solution yet as most of them are only trying to remove one duplicate line.

A little help PLEASE!


In reply to Sorting By Column by Roguehorse

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.