hi every body,<br>i have compared two files:<br>code:<br><br>fh = open('HPRD_MAIN_20.txt','r')<br>for line in fh.readlines():<br>        data = line.strip().split('#')<br>        fh1 = open('NOMENCLATURE_MAIN_20.txt','r')
<br>        for line1 in fh1.readlines():<br>                data1 = line1.strip().split('#')<br>                if  data1[0] == data[0]:<br>                        result = data[0] +'#'+data[3]+'|'+ data[4]+'|'+data[9]+'|'+ data1[3]
<br>                        print result<br>the result was as given below:<br><br><br>00017#ACTG1|actin, gamma 1|Actin gamma 1|ACTG<br>00017#ACTG1|actin, gamma 1|Actin gamma 1|Actin gamma<br>00017#ACTG1|actin, gamma 1|Actin gamma 1|Cytoskeletal gamma actin
<br><br><br>but i need the result to be like this :<br><br><br>00017#ACTG1|actin, gamma 1|Actin gamma 1|ACTG,Actin gamma,Cytoskeletal gamma, actin<br><br><br>with out redundancy and the name in the same line separated by commas..
<br>please suggest what should i do for this to get the result like this.<br><br><br>regards<br>shafreen<br><br>