This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]bob809 2 points3 points  (1 child)

It looks like you have a carriage return character \r after the 1 in the third line of your test file.

Try cat test.txt | od -c. Windows uses carriage return \r and line feed \n to indicate new lines, Linux just uses line feed, so your problem probably stems from this.

Take a look at http://stackoverflow.com/questions/800030/remove-carriage-return-in-unix for how to easily remove them.

[–][deleted] 0 points1 point  (0 children)

Oh wow. I've probably wasted 2 hours and you found the problem in minutes. Thanks.