

Windows uses both CRLF at the end of a line, whereas Unix uses only a LF. Because of the way the the older regular expression syntax works, the replace might not replace all consecutive blank lines in your text file.End of Line characters include CR or LF. You might need to click Replace all several times to ensure all blank lines are removed.

Replace With: "" (without the quotes - i.e. You'll need to check the Regular expressions option in the Replace dialog.įind What: " %+++" (without the quotes) I'm using an even older version that doesn't support Perl regex.do you have a solution for me?ĭid we mention that you should really consider upgrading? Anyway, if you're using a previous version of UltraEdit that doesn't support Perl regex, to delete blank lines you can use a regular expression replace as follows. Note: Click Replace all once to replace all – even consecutive – blank lines in a text file. Replace With: "" (without the quotes - i.e., nothing). Enable Perl regular expressions by clicking the gear button in the Find dialog to show the advanced search options, or prior to UltraEdit v14.00 enable "Perl compatible Regular Expressions" under Advanced » Configuration » Search » Regular Expression Engine.įind What: " ^(?:*(?:\r?\n|\r))+" (without the quotes) Well, beside the fact that you should consider upgrading to get this functionality in a single click, in previous versions of UltraEdit where Perl regular expressions are supported, you can use the following Perl regex to delete all blank lines in your text file. Again, if text is selected, then this operation is restricted only to the selected text.īut I don't have this version (or I just like making things complicated).

This means that lines containing literally nothing are deleted as well as lines containing only spaces and/or tabs. This will delete all lines in the file that contain no non-whitespace characters. Delete all empty and whitespace-only lines If text is selected, then the operation is restricted only to the selected text. This will delete all lines in the file that contain no characters or whitespace. These options work as follows: Delete all empty lines Starting with UltraEdit v24.20 (and UEStudio v17.20), there are a couple of options for deleting all blank lines from a text file in the Edit » Delete drop down:

A question which users frequently have is: "I have a lot of blank lines in my file and I don't want to go through and manually delete them.
