Thanks for your reply robert. As you pointed out, there was a blank line that the ruby program reads. That was the problem. Sorry about my carelessness. Thanks again. Soichi -- Posted via http://www.ruby-forum.com/.