It would be better to check the dataset loaded from the file rather than the file itself. There can be a lot of tricky things in the txt that are hard to catch by eye, a space delimiter instead of a tab, an extra '\n' at the end, etc.
Try a
which(is.nan(X))
It looks like there's just one observation giving you a problem.