The code you had in the first post you used Write, which is used to write data.
In your input code you used Line Input, which is used to read line terminated strings.
You should have been using...