count increment...

Beema shafreen beema.shafreen at gmail.com
Sat Nov 3 02:09:31 EDT 2007


hi, evrybody....
I have file
A_16_P21360207    304
A_14_P136880    783
A_16_P21360209    795
A_16_P21360210    173
A_16_P03641959    1177
A_16_P03641960    1944
A_16_P03641962    999
A_16_P41563648    -31
A_16_P03641963    3391
A_16_P41563649    3626
A_16_P03641964    180
A_16_P41563655    1216
A_16_P03641965    1170
A_16_P03641966    194
A_16_P21360229    290
A_16_P03641967    425
A_16_P21360231    1091
A_16_P03641968    1167
A_16_P03641969    421
A_16_P03641970    63
A_16_P21360234    290
A_16_P21360235    289
A_16_P03641971    398
A_16_P21360237    418
A_16_P03641972    122
A_16_P21360239    16
A_16_P03641973    2187
A_16_P41563669    2881
A_16_P03641974    1101
A_16_P03641975    451
A_16_P03641976    2203
A_16_P41563677    7927
A_16_P21360249    5749
A_16_P21360257    303
A_16_P03641977    2307
A_16_P21360259    2102
A_16_P03641980    270
my script:

#!/usr/bin/env python


fh = open('complete_span','r')
line = fh.readline().split('#')
old_probe = line[0].strip()
old_value = line[1].strip()
print old_probe, old_value
count = 1
line = ""
while line:

        line = fh.readline().strip()
        if line :
                current_probe, current_value = line.split('#')[0:2]
                probe  =current_probe.strip()
                value  = current_value.strip()
                if int(old_value) > int(value):
                        res_value='%s\t%s'%(old_value, old_probe)
                        print res_value

        if count >= 244000:
               break
        old_probe,old_value =probe, value
fh.close()
I need to increment the line........ until the line count is 244000..... i
havescript but... it doesnot work... can anybody... chekc and let me know
what was the problem...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071103/29592e5e/attachment.html>


More information about the Python-list mailing list