Yes Chris, I understand, My Original code was for l in f1: sp = l.split(",")
if len(sp)!= 12: continue else: ix = sp[0].strip() iy = sp[1].strip() for s in f2: st = s.split(",") if len(st)!= 11: continue else: clas = st[10].strip() print ix, iy, clas print >> nf, ix, iy, clas f1.close() f2.close() nf.close() where f1 contains something like : 297, 404, , .... 298, 404, , ...... 299, 404, ..... ..... ...... 295, 452, .... and f2 contains something like : .... 7 ..... 2 ....2 .....7 and what I want to be written in the new file i.e. nf is something like: 297 404 7 297 404 7 297 404 7 297 404 7 297 404 7 297 404 7 297 404 7 297 404 7 297 404 7 297 404 7 297 404 7 297 404 7 297 404 7 297 404 7 297 404 2 297 404 2 297 404 2 297 404 2 297 404 2 which m getting but partially correct because only last value is changing not the first two... which should not happen.. In every loop all the three values should change..
-- http://mail.python.org/mailman/listinfo/python-list