deepakshyl has asked for the wisdom of the Perl Monks concerning the following question:
ORF PHAGE_NAME START END Hvalue
***************************************************************************************************************
orf00007 PHAGE_Prochl_MED4_213_NC_020845-gi|472340344|ref|YP_007673870.1| 7665 8618 0.210897481636936
orf00007 PHAGE_Prochl_P_HM2_NC_015284-gi|326783200|ref|YP_004323597.1| 7665 8618 0.207761175236097
orf00007 PHAGE_Prochl_P_HM1_NC_015280-gi|326782251|ref|YP_004322652.1| 7665 8618 0.207761175236097
orf00007 PHAGE_Prochl_Syn1_NC_015288-gi|326784174|ref|YP_004324567.1| 7665 8618 0.176257712486884
orf00007 PHAGE_Cyanop_P_RSM6_NC_020855-gi|472341546|ref|YP_007675062.1| 7665 8618 0.201443231899265
orf00007 PHAGE_Synech_syn9_NC_008296-gi|113200706|ref|YP_717869.1| 7665 8618 0.188906505771249
1. ignore 1st and 2nd line
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
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.
The code i had tried for it is
#!/usr/bin/perl
#use strict;
use warnings;
open FILE,"out07.txt";
my @fields = split / /, <FILE>;
chomp @fields;
my @lines = split (/(\n)/, "@fields");
for (@lines)
{
print @fields,"\n";
}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting using the highest last column criteria
by AppleFritter (Vicar) on Jul 27, 2014 at 17:48 UTC | |
|
Re: Sorting using the highest last column criteria
by Bethany (Scribe) on Jul 27, 2014 at 15:22 UTC | |
by deepakshyl (Novice) on Jul 27, 2014 at 17:23 UTC | |
by Bethany (Scribe) on Jul 27, 2014 at 20:20 UTC | |
|
Re: Sorting using the highest last column criteria
by Anonymous Monk on Jul 27, 2014 at 15:13 UTC |