I need to delete all empty lines on a PHP file, hot to do this with find a replace or other method?
thanks
Delete ALL Empty Lines In PHP File
Moderator: kfury77
Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
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;
Re: Delete ALL Empty Lines In PHP File
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.
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
-
- Posts: 36
- Joined: Sat Feb 21, 2015 1:50 am
Re: Delete ALL Empty Lines In PHP File
Thanks the plugin worked although it takes while on large files 
The find and replace method leaves me with more of a minified file which isn't what I wanted.

The find and replace method leaves me with more of a minified file which isn't what I wanted.
Re: Delete ALL Empty Lines In PHP File
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.)energylevels wrote:Thanks the plugin worked although it takes while on large files
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.