clarification

Beema shafreen beema.shafreen at gmail.com
Thu Aug 16 11:42:26 CEST 2007


hi every body,
i have compared two files:
code:

fh = open('HPRD_MAIN_20.txt','r')
for line in fh.readlines():
        data = line.strip().split('#')
        fh1 = open('NOMENCLATURE_MAIN_20.txt','r')
        for line1 in fh1.readlines():
                data1 = line1.strip().split('#')
                if  data1[0] == data[0]:
                        result = data[0] +'#'+data[3]+'|'+
data[4]+'|'+data[9]+'|'+ data1[3]
                        print result
the result was as given below:


00017#ACTG1|actin, gamma 1|Actin gamma 1|ACTG
00017#ACTG1|actin, gamma 1|Actin gamma 1|Actin gamma
00017#ACTG1|actin, gamma 1|Actin gamma 1|Cytoskeletal gamma actin


but i need the result to be like this :


00017#ACTG1|actin, gamma 1|Actin gamma 1|ACTG,Actin gamma,Cytoskeletal
gamma, actin


with out redundancy and the name in the same line separated by commas..
please suggest what should i do for this to get the result like this.


regards
shafreen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070816/4cc77f1b/attachment.html>


More information about the Python-list mailing list