Hi all...

I have a input file (predictions.txt) that has a repeated pattern like:

Code:
# <Few comment lines> 
#
# Prediction output 
# NP_414543.1
    1 M     0.0799
    2 R     0.1298
    3 V     0.1251
    4 L     0.6823
    5 K     0.8224
    6 F     0.9323
    7 G     0.5909
# <Few comment lines>
#
# Prediction output 
# NP_414743.1
    1 M     0.0799
    2 R     0.1298
    3 V     0.1251
    4 L     0.6823
    5 K     0.8224
# <Few comment lines> 
#
# Prediction output 
# NP_414594.1
    1 M     0.6583
    2 V     0.5399
    3 K     0.6731
    4 V     0.7323
    5 Y     0.6583
    6 A     0.2888
    7 P     0.9251
    8 A     0.7028
    9 S     0.6765
    10 T    0.5583
# <Few comment lines>  
...
..
From this, I need to calculate whether minimum 4 consecutive residues in each 'prediction output' have a value of >0.5 (third column). In the (output.txt) file I need to print the matched identifiers (below 'Prediction output' line) and first column number range (where consecutive residues of 4 or more have a value of >0.5). For this input,(output.txt) will contain:

NP_414543.1: 4-7
NP_414594.1: 1-5,7-10
any help? thanx