When you need to edit a file on Linux, it is highly recommended that you use a linux text editor. If you’re using a windows machine or something else, the editor you use might introduce carriage return characters into the end of every line. This can prove to be a problem as it WILL wreak havoc on your system.
I recommend and like vi, because it’s powerful and is installed by default on every linux system, however, if you don’t have access to the linux box, might I suggest you install cygwin and use vi from cygwin to actually do the editing and just upload the file.
While vi is hard to use, there is a post on this blog about using vi as well as the ability to borrow the book using kindle on Amazon.com
There are other alternatives:
nano: a very easy to use text editor.
emacs: if you’re going to learn emacs, you might as well learn vi. The learning curve is steep, but if you’re going to do it, do it on something you’ll use across many platforms and is guaranteed to be there on every linux distribution.
vim: a jazzed up version of vi. While I like vim, it’s not the default install and I just prefer to use whatever is there.
If you must use something, I suggest using notepad or wordpad. If the formatting looks horrible in notepad, load the file into wordpad.
After you have edited the file, upload to the server and run: dos2unix filename filename.converted
then type cat filename.converted to make sure it is a good looking file. then delete the initial file and rename filename.converted to filename.