Hi, I am new to perl, and trying to extract raw data into a more meaningful format. Any kind of help will be appreciated. I have this input file with two columns each one is filled in an array NP_041954.1 NP_848263.1 NP_041955.1 NP_041956.1 ----- 1 row NP_041956.1 NP_041955.1 ------ 2 row NP_041957.1 NP_848264.1 I want to get the columns for the condition where- column[0] of one row is equal to column1 of another row and vice versa. For example this condition holds true for 1st and 2nd row above. I need the print out only once showing the column 1 and column 2 (i.e in this case- NP_041955.1 AND NP_041956.1) for which the condition is true. What will be a good approach to get this? Thanks

In reply to how to compare column 1 to column 2 and vice versa from multiple rows. by BhariD

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.