IDM PowerTips

Hide, show, and delete found lines in UltraEdit / UEStudio

In this power tip, we’ll take a look at how to filter lines containing a specific string in UltraEdit and UEStudio using the Find dialog. This power tip is divided into 3 parts:

  • Show only lines containing search string
  • Hide all lines containing search string
  • Delete all lines containing search string

Show only lines containing search string

For this example, we will search UltraEdit’s “changes.txt” file for the words “hide” or “show” – our search string is a Perl regular expression that searches for either string at once: hide|show. (Learn more about the power of Perl regex.) Initially, we would like to view ONLY the lines that contain either of those two words.

First, open the Find dialog (hold Ctrl and press F twice to bypass Quick Find and open the large Find dialog) and type your find string.

Before clicking “Next”, let’s check the “Filter lines” option and select “Show”:

Note: If you do not see the Hide/Show radio buttons, click on the gear icon to expand the advanced options.

Click “Next”, and as you can see, our file has been filtered to display ONLY lines containing the text “show” or “hide”:

You can unhide these hidden lines at any time by pressing Ctrl + × (Multiply on the Numeric Keypad) or by going to View − Hide/Show Lines − Expand All.

Hide all lines containing search string

Obviously, if we want to hide all lines containing our search string, we’d simply select the “Hide” option under “Filter lines” instead. Let’s say we want to hide all sub-items in the changes list – i.e., any line that begins with four spaces and an asterisk. Using the Perl regex character “^” to represent the start of a line, the following regexp should do it: ^ {4}\*.

Click “Next”, and again our file is filtered to hide all lines starting with four spaces and then an asterisk:

Delete all lines containing search string

After hiding/showing lines, as described above, you can delete hidden lines by going to Edit − Delete − Delete All Hidden Lines.

In this example, our result is a file that no longer includes lines starting with four spaces and then an asterisk: