Thank you for replying to the post but i do not want it to get separated by "|"
My first column is :gnl|dbSNP|rs13484116
second column: gi|62750812|ref|NC_005111.2|NC_005111
third: 100
fourth: 16
fifth: 0
sixth: 0
seventh: 300
eighth: 460
Ninth: 28912367
and tenth: 28912382 and so on..
my code:
from __future__ import with_statement
with open ('C:\\Documents and Settings\\Desktop\\file2.txt') as fil:
f = fil.readlines()
result = []
for line in f:
line = line.split()
if len(line) >= 3:
i = float(line[2])
if 90 <= i < 100:
line = ' '.join(line)
result.append(line)
with open('C:\\Documents and Settings\\Desktop\\j3.txt','w')as resultfile:
resultfile.write('\n'.join(result))
is taking input file ( which has tabs exactly as i explained above)
gnl|dbSNP|rs13484116 gi|62750812|ref|NC_005111.2|NC_005111 100 16 0 0 300 460 28912367 28912382 4.4 32.3
gnl|dbSNP|rs13484116 gi|62750812|ref|NC_005111.2|NC_005111 95 20 1 0 300 387 31017559 31017578 4.4 32.3
and result file is:
gnl|dbSNP|rs13484116 gi|62750812|ref|NC_005111.2|NC_005111 95 20 1 0 300 387 31017559 31017578 4.4 32.3
gnl|dbSNP|rs13484118 gi|62750812|ref|NC_005111.2|NC_005111 91.67 24 2 0 63 86 35247737 35247714 4.4 32.3
i just want my result file to be tab delimited as my input file so that i can put it in xl sheet and do whatever i have to ..or can parse it again for many different things for which i already have codes...
Please help me on this...
Many Thanks...