in reply to Sorting using the highest last column criteria

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.

  • Comment on Re: Sorting using the highest last column criteria