doesn't seem to fix php...
Main Topics
Browse All TopicsI have some scripts that keep getting double spaced due to someone elses FTP program. I have asked them to stop using it but it's already affected many files and it's too late to go back into the old versions of the code because we've committed these spaces to our repository due to time restrictions.
How can I single space the file easily in dreamweaver. I'm willing to use another utility if necessary.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Okay.
The reason this happened is that the other user has a different line-break method set than you do. DW probably isn't the best tool for this because you would need to run a Find and Replace on two blank lines in Source Code mode and I can see that not working as expected.
Go grab NotePad++ as it has an option to remove blank lines under its TextFX | TextFX Edit menu.
MeridianManagement,
This might be something where a Regex could help too. Does Notepad++ support those for a replace? Can you provide a sample file so I can make sure I understand how the file is affected? If Notepad++ won't work with a Regex then there are other programs that will although I am not sure of free ones that you can use. I believe there are some but I would have to verify first.
The PSPad editor has a number of features too so it might also have an option to strip the extra lines and not be bothered by PHP. Let me know if you want me to test and verify this but a sample file will help this.
Let me know if you have any questions or need more information.
b0lsc0tt
If so, and without a sample to be sure, then you would need some a regex like the following for the test ...
\r\n\r\n
... and then in the replace you just provide a line break (i.e. hit the Enter key probably although I can provide characters if the program can convert them).
The thing I don't know for sure is if the file that is being read wrong actually has a carriage return and a new line character or just the new line character. Most likely the former. I have seen files "messed up" like this before but never bothered to spend the time to see why or try to fix them. Homesite just corrects them in the display but it is annoying to have them messed up.
A sample will really help. Also if you have a question trying to use the above then let me know about the program and choices you see.
bol
Opalelement,
That may or may not work as expected. If another user opens the file in a different editor you may get different types of line breaks. That's why b0lsc0tt suggested regex and I suggested Notepad++ because those options can handle \n\n \n\r or \r\n depending on how the other editor threw those in. DW will handle a blank line in Find and Replace differently depending on which line break type is chosen in the options.
It is the \r\n that is used (i.e. a carriage return followed by the new line character). In the match field (or its equivalent) use ...
\r\n\r\n
... and in the replace field you would either place ...
\r\n
... or just press Enter. Now that will get rid of every occurence, except 4 in the case of your file above. In that file it looks like 4 lines already had the double space so they actually have 3 line breaks now. You could run it again if you want to get rid of them all but maybe you want to keep those.
Let me know how it works. If Dreamweaver has a problem then I used a program called EditPad (actually the Pro version) to run it and it worked. Let us know if you have a question.
bol
Business Accounts
Answer for Membership
by: jason1178Posted on 2009-07-01 at 13:08:49ID: 24757752
Hi MeridianManagement,
You can do Commands | Apply Source Formatting to fix excessive whitespace.