2. Take colum one and compare the row 3 and 4 it should be equal
3. Take colum two and comapre the row 3 and 4 it should be equal

What if they aren't, like in your example? The second fields in row 3 and 4 are, respectively, "PHAGE_Prochl_MED4_213_NC_020845-gi|472340344|ref|YP_007673870.1|" and "PHAGE_Prochl_P_HM2_NC_015284-gi|326783200|ref|YP_004323597.1|": not the same.

Or do you want to compare other fields, and not PHAGE_NAME?

4. then check colum 4 and check row 3 and 4 greater value, if found the greater value check with the next row and print greater value of the same group.

Could you clarify what you mean by "the same group" -- the entire file? (And BTW, I assume that you want continue this list-folding process beyond those rows, right?)

It'd be good if you could share, at the minimum, the expected output for your example data.


In reply to Re: Sorting using the highest last column criteria by AppleFritter
in thread Sorting using the highest last column criteria by deepakshyl

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.