Delete ALL Empty Lines In PHP File

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.

  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;

Delete ALL Empty Lines In PHP File

Postby energylevels » Mon Jul 30, 2018 5:45 am

I need to delete all empty lines on a PHP file, hot to do this with find a replace or other method?

thanks
energylevels
 
Posts: 25
Joined: Sat Feb 21, 2015 1:50 am

Re: Delete ALL Empty Lines In PHP File

Postby Aivars » Mon Jul 30, 2018 10:06 am

You can either use Search & Replace or the specialized plugin.

To use Search & Replace, use menu Search -> Replace, click Multi Line, hit enter twice in Search for field and leave Replace with field empty.

To use the plugin, use menu Plugins -> Manage Plugins, go to Plugin Catalog tab, install Remove Empty Lines by pmk65. After that you can use it from menu Plugins -> Remove Empty Lines.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2282
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Delete ALL Empty Lines In PHP File

Postby energylevels » Wed Aug 08, 2018 1:10 am

Thanks the plugin worked although it takes while on large files :D

The find and replace method leaves me with more of a minified file which isn't what I wanted.
energylevels
 
Posts: 25
Joined: Sat Feb 21, 2015 1:50 am

Re: Delete ALL Empty Lines In PHP File

Postby pmk65 » Wed Aug 08, 2018 10:15 am

energylevels wrote:Thanks the plugin worked although it takes while on large files :D


I made an update a while ago, but haven't bothered updating the filelink as there was no feedback. (Without feedback, I have to assume that people don't use the plugin. And as such they don't need/want updates.)

But send me a PM if you are interested in testing the new version.

The new version does the replacement in one take, without looping over each line. So it should be MUCH faster than the old version. ;)
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 584
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: Bing [Bot] and 3 guests

cron