The tempstr was something left over from me simplifying the code for this site, but the use of the readline command twice was the issue here. I didn't realize that readline not only read the line but advanced to the next line each time its used. I used some code that was very similar to your suggestion and it worked great.

Thanks a lot.