Hi Danny: I have ~50 files in this format:
File1: 680:209 3006.3 266:123 250.5 62:393 117.3 547:429 161.5 341:311 546.5 132:419 163.3 98:471 306.3 File 2: 266:123 168.0 62:393 119.3 547:429 131.0 341:311 162.3 132:419 149.5 98:471 85.0 289:215 207.0 75:553 517.0 I am generating these files using this module: f1 = open("test2_cor.txt","r") ana = f1.read().split('\n') ana = ana[:-1] pbs = [] for line in ana: cols = line.split('\t') pb = cols[0] pbs.append(pb) ##########CEL Files section ######## files = glob.glob("c:\files\*.cel") def parSer(file): f1 = open(file,'r') celf = f1.read().split('\n') celfile = celf[24:409624] my_vals = celParser(celfile,pbs) f2 = open(file+'.txt','w') for line in my_vals: f2.write(line+'\t') f2.write('\n') f2.close() def main(): for each in files: parSer(each) main() Because, I asked to write a file with the name of the file as output, it is generating 50 output files for 50 input files. What I am interested in is to append the output to one single file but with tab delimmitation. For example: for each file there are 2 columns. Cor and val file 1 file 2 file 3 file 4 cor val cor val cor val cor val x:x 1345 x:x 5434 x:x 4454 x:x 4462 x:y 3463 x:y 3435 x:y 3435 x:y 3435 Could you suggest a way. Thank you. __________________________________ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor