You can restrict the search (or replace) to a highlighted block, even a columnar block. This is useful for search & replace operations that you only want to make in a portion of the file. For example, you might highlight the “Zipcode” field in a data file to restrict your search to only zipcode numbers.

vEdit both follows the common Windows conventions for searching within a block, and has additional options that are useful when working with huge multi-megabyte blocks. When “Persistent blocks” are enabled (the default), you can search for multiple occurrences within the block, move within the block, search for something else, etc.

How to Search Within a Block of Text

  1. Highlight the desired text as a stream, line or columnar block. The search will only match characters which are entirely within the highlighted area.
    • For example, if you highlight a columnar block and search for “12345”, it will not match an occurrence where “123” is within the columnar block, but “45” is outside the columnar block.
  2. Select SEARCH > Search ( F2 or Ctrl-F ).
    1. If the cursor is within the block, the [ ]Block option will already be enabled; otherwise, enable this option.
    2. If the cursor is within the block, the [ ]Begin option will also be selected to start the new search at the beginning of the block. If you only want to search the partial block beginning at the cursor position, disable this option.
  3. Enter the search string and select any other options as usual. Press the button corresponding to the desired search direction.
    • Note that if you search in reverse with the Previous button, the search starts at the end of the block.
  4. To search for additional occurrences simply press F3 - or - SEARCH > Next.

Unlike vEdit, many other editors always force a new search to start at the beginning of the block after you highlight the text. vEdit has additional flexibility so that you can:

  • Begin highlighting a block and then search for the desired end of the block.
  • Highlight a block and then search outside the block, e.g. search for the location to which you want to copy the block.
  • Search only that portion of the block after the cursor. For example, you could search within a huge block for the third occurrence of “xyz” following the first occurrence of “abc”.

The following rules determine vEdit’s behavior when a block has been highlighted and you then select SEARCH > Search or SEARCH > Replace.

  1. If the beginning of the block has been set, but the current block size is zero ( e.g., you just pressed F9 ), it is assumed that you want to search for the end of the block, and nothing special is done.
  2. If the cursor is within a small highlighted “stream” block of 40 characters or less, the block is used as the search string. The search is not within this small block.
  3. If the cursor is within, or immediately past, the highlighted block, the [ ] Begin and [ ]Block search options are automatically selected.
    • Disable the [ ]Begin option if you want to search only from the cursor position instead of from the beginning of the block.
    • Disable the [ ]Block option if you want to search the entire file instead of just within the block.
  4. If the cursor is not within the block and you select the [ ] Block option, a forward search automatically starts at the beginning of the block. Similarly, a backwards search starts at the end of the block.
  5. The entire search string must be found within the highlighted text; this is especially important when searching within columnar blocks. (In other words, vEdit will not locate a word where half of it is highlighted and the other half is not highlighted.)

Related Resources