How do I remove extra spaces added to my code by FTP?
This happens repeatedly and is very annoying. I am uploading PHP code to a client server. Several weeks pass. They are asking for changes and I will re-upload the code as they made some changes. However, my code, which was once neat and tidy, the last time I looked at it, now contains extra lines of whitespace. So now that I had two lines of space between some code, we now have 3. Where I had a lot of lines sticking together because they were part of the same loop or such, they are all scattered around now and there is no way to tell them apart.
Is there any program / utility to fix this?
I bet this is caused by systems trying to convert text files created on a Windows system to files used by a Unix / Linux system (and vice versa).
Windows uses both carriage return and line feed, and I think Unix only uses line feed (or is it a carriage return).
I used Ultra Edit as my main text editor (not that Emacs and vi don't control: o) and it has DOS mode and Unix mode for this sort of thing.
source to share
I am assuming you are developing on a Unix / Max system, but the client is running on a Windows system (or vice versa). I will also assume that you are uploading / downloading your files in binary mode. The window editor probably turns the Unix LF into an LF / CR pair, which your thren editor treats as two new lines. If you upload and download in ASCII mode, the files are automatically converted between the two formats.
source to share