Much of the time, there are two things to look at.
One is, if you are editing the file on Windows, the CR (carriage control) LF (line feed) [EOL] (end of line) marker needs to be changed to just LF for Linux. Some editors and tools allow for this with an option while others do not. Also keep in mind that there are 3rd. party tools that get in the way of the process such as management tools.
The second is how the file is transferred. Most of the time, an FTP client is used and text is not the default transfer method, however, most FTP clients will use text for a .txt file extension at least. I have had to specifically select text over binary even for obvious text files before. Most FTP clients will handle file extensions correctly. Still, sometimes the file is not converted correctly even with the best of intentions. As well, I have seen FTP servers at fault here though rarely.
Whenever you see a problem like this, check to see if the uploaded file matches the original with something like WordPad where the code can be examined. This can tell you if the file is being uploaded correctly. Many control panels will allow you to open a file transparently to properly compare the two. If the upload is not handling the [EOL] marker properly, then it is likely the transfer method. For FTP, you can always force text transfers over binary. If this still does not work, then in any control panel, you can simply upload the file. Some will make the change for you. If that still does not work use SSH (shell) and edit the file, remove the contents, then cut and paste from the original. This should always work. For smaller files, this works a treat. For larger files, it can be frustratingly slow but should work fine as well.