in reply to text file parsing
I don't see any obvious spots where the program might go into an infinite
loop and without more information it is hard to tell where to start.
A general strategy for debugging these sorts of problems
is to put print statements in the code saying "I got here"
and then run it to see if you got there. If you got there,
check later in the program, if not, check earlier. This will
allow you to soon find the pathological code.
To help us solve your problem, you might also describe how
the code hangs. Is any output produced? Did you try -w
to catch typos?
-Mark