Question

fix source code in dreamweaver that is double spaced

Asked by: MeridianManagement

I 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.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-07-01 at 13:05:48ID24537653
Topics

Adobe Dreamweaver

,

PHP Scripting Language

,

Hypertext Markup Language (HTML)

Participating Experts
4
Points
500
Comments
16

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

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.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

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.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

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.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. SSL & Dreamweaver
    OK I have exhausted everything I know about Dreamweaver, so good luck. We recently installed an SSL certificate at my work and now I can not get Dreamweaver to properly setup a testing server correctly. When I set up a testing server and specify the URL as https://91intrane...
  2. FTP error using Dreamweaver
    I'm using Dreamweaver CS3 on a Mac. It worked no problem for a week and a half then I stopped being able to connect via FTP. It gives me the following warning. An FTP error occured - cannot make connection to host. No response from the server. This may be due to one or more ...
  3. Dreamweaver / FTP
    I have a web developer that makes sites in Dreamweaver on his mac. I set up an SFTP server on the web server for him to connect to. I can connect to it just fine using my SFTP client, but when he tries to connect with Dreamweaver, I see his IP on the SFTP server briefly (so...
  4. dreamweaver
    I have an old ASP webpage that I have to maintain. I know NOTHING about web developement, publishing just basically I know NOTHING. I though I would try Dreamweaver ( mainly because they have a free trial - if it works I'll buy it ) Is there a way to open my old website ( the...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

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.

Join the Community

Answers

 

by: jason1178Posted on 2009-07-01 at 13:08:49ID: 24757752

Hi MeridianManagement,

You can do Commands | Apply Source Formatting to fix excessive whitespace.

 

by: MeridianManagementPosted on 2009-07-01 at 13:10:20ID: 24757761

doesn't seem to fix php...

 

by: jason1178Posted on 2009-07-01 at 13:16:09ID: 24757809

Hmph, it apparently doesn't.  Are these pages just PHP code or mixed PHP and HTML?

 

by: MeridianManagementPosted on 2009-07-01 at 13:17:07ID: 24757813

mixed. There is also a lot of javascript files with the same issue.

 

by: jason1178Posted on 2009-07-01 at 13:23:25ID: 24757856

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.

 

by: MeridianManagementPosted on 2009-07-01 at 13:27:18ID: 24757883

Thanks Jason,

That's definitely a pretty close solution. I was hoping it would be possible to only replace every other line (not everyone empty line), because technically there are some line breaks for a reason. If you can think of anything let me know

 

by: jason1178Posted on 2009-07-01 at 13:32:35ID: 24757931

You can apply the Notepad++ solution selectively.  So highlight the code that has the excessive line breaks and apply the TextFX.  It will only remove the line breaks from the selected area.

 

by: b0lsc0ttPosted on 2009-07-01 at 15:45:23ID: 24758952

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

 

by: jason1178Posted on 2009-07-01 at 15:46:46ID: 24758960

b0lsc0tt,

Good points.  NotePad++ does support regex, as does DW but DW's regex interpreter is a little limited.

 

by: b0lsc0ttPosted on 2009-07-01 at 15:56:01ID: 24759017

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

 

by: OpalelementPosted on 2009-07-01 at 23:58:45ID: 24760943

If you replace two newlines with one newline in dreamweaver find&replace, it should only take out every other line

 

by: jason1178Posted on 2009-07-02 at 10:10:59ID: 24765420

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.

 

by: MeridianManagementPosted on 2009-07-02 at 11:08:20ID: 24766001

okay here's an example of a file. It was partially fixed in dreamweaver that's why some of the file looks okay.

 

by: MeridianManagementPosted on 2009-07-02 at 11:09:59ID: 24766022

Here you go, it didn't like the php extension

 

by: b0lsc0ttPosted on 2009-07-02 at 11:28:07ID: 24766189

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

 

by: m_abdelfattahPosted on 2009-09-09 at 05:53:35ID: 25290639

This should be the solution :
1. Open Dreamweaver Preferences ( Edit -> Preferences ).
2. Select Code Format
3. Change Line break type to LF (UNIX)

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...