On Mar 3, 12:36 pm, Bruno Desthuilliers > [snip] > DATE = 5 > TARGET = 6 [snip] > Now for the bad news: I'm afraid your algorithm is broken : here are my > test data and results: > > input = [ > #ID STATE ... ... ... TARG DATE > "aaa\tAAA\t...\t...\t...\tBBB\t20071212\n", [snip]
Bruno, The worse news is that your test data is broken. According to the OP (and your own code (DATE = 5 etc)), the target state comes last. GIGO. At least you have demonstrated to the OP why naming the field indexes is a good idea :-) Cheers, John -- http://mail.python.org/mailman/listinfo/python-list