deepakshyl has asked for the wisdom of the Perl Monks concerning the following question:
INPUT orf00007 PHAGE_Prochl_MED4_213_NC_020845-gi|472340344|ref|YP_007673870.1| 7665 8618 0.210897481636936 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 orf00015 PHAGE_Megavi_lba_NC_020232-gi|448825467|ref|YP_007418398.1| 11594 13510 0.278721920668058 orf00015 PHAGE_Acanth_moumouvirus_NC_020104-gi|441432357|ref|YP_007354399.1| 11594 13510 0.278721920668058 THE SCRIPT I HAD IMPLEMENTEDNOTE: 1) I need to take the last column as the analysing criteria to print the entire row(the float value, eg:0.210897481636936) 2) for example if the user input value is '0.210' we have to print the rows having >= values ,the expected output is OUTPUT orf00007 PHAGE_Prochl_MED4_213_NC_020845-gi|472340344|ref|YP_007673870.1| 7665 8618 0.210897481636936 orf00007 PHAGE_Prochl_MED4_213_NC_020845-gi|472340344|ref|YP_007673870.1| 7665 8618 0.210897481636936 orf00015 PHAGE_Megavi_lba_NC_020232-gi|448825467|ref|YP_007418398.1| 11594 13510 0.278721920668058 orf00015 PHAGE_Acanth_moumouvirus_NC_020104-gi|441432357|ref|YP_007354399.1| 11594 13510 0.278721920668058use feature qw/say/; use Math::Trig; open FILE,"out02.txt"; my @file= <FILE>; close FILE; my $aa = 0; for (my $i =$aa; $i <=17822; $i++) { if(($file[$i] >= 0.210)){ open (OUTFILE,'>>out_t10-t10.txt'); print OUTFILE $file[$i]; } else{} }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: printing the entire row with particular given last column criteria
by Laurent_R (Canon) on Jul 31, 2014 at 06:22 UTC | |
|
Re: printing the entire row with particular given last column criteria
by Anonymous Monk on Jul 31, 2014 at 06:02 UTC | |
|
Re: printing the entire row with particular given last column criteria
by thanos1983 (Parson) on Jul 31, 2014 at 13:47 UTC |