This seems more of dos to unix kind if problem i.e DOS places both a line feed and a carriage return character at the end of each line of a text file, but Unix uses only a line feed character.
So the CR character (^M i.e ascii 13) must be appearing as box

regds
tshot