[Tutor] Tab delim file
Srinivas Iyyer
srini_iyyer_bio at yahoo.com
Tue Mar 1 23:21:58 CET 2005
Hello:
I have a nasty file where I have 165 column and 140K
lines.
For every 12 columns, a new dataset is written.
0-12 - File A's data is there
13-24 - File B's data is there.
My task is to write data in each 12 columns to a file.
I have a rough idea, but when I try I am unable to
proceed further.
f1 = open('my_file.txt','r')
aml = f1.read().split('\n')
fLine = aml[0]
k = len(fLine)/12 # k = 162/12
#So I want to jump k blocks and get the text.
for line in aml:
cols = line.split('\t')
while i > 13:
......
I am lost from here...
Every 4 line(row) contains the file name on which I
have to write the file.
can any one plese help, i am really stuck in a
problem.
thanks
srini
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the Tutor
mailing list