in reply to To infinity and beyond: Embedding loops


your problem isn't really clear to me. Perhaps it will be helpful if you show examples of your inputfiles and an example of your expected output.

Be that as it may, your momentary shown code didn't do an infinite loop.

greetings, tos