Exercise 3.9: Filtering lines by string

Before you begin, you must complete Exercise 3.8: Finding and replacing text.

The editor allows you to filter or subset your source so that you see only lines containing a given string. Filtering lines makes it quick and easy to find lines without having to scroll through your source.

To filter source by string:

  1. Double-click the variable EMPNO in the Editor window.
  2. Select Edit > Selected > Filter Selection from the workbench menu.
    Editor window showing all lines with EMPNO variable
  3. Move the cursor down a few lines to line 302.
  4. Expand line 302. This expands the section up to the next instance of EMPNO.
    Section expanded

    Now you want to show the entire source again.

  5. Click Edit > Show all from the workbench menu or press Ctrl+W.

    Your cursor is still positioned on the same line that you moved the cursor to, even though all lines are now showing.

You have filtered your source so that you see only lines containing a given string and now you are ready to begin Exercise 3.10: Filtering lines by type.