in reply to Script is writing output twice; second time in reverse order

This was successfully debugged by ikegami on Stackoverflow

Just want to help avoid the duplication of effort since OP's typically fail to update their cross-posts.

  • Comment on Re: Script is writing output twice; second time in reverse order