Find and Replace Information in a Data File

Restriction: You can only replace data with data of the same length.
  1. From the Micro Focus Data File Tools window, click File > Open > File, or click The Open File icon (Open File).

    The Open dialog box appears.

  2. Navigate to the required data file, then click Open.

    The Open Data File dialog box appears.

  3. If you are applying a record layout, click Browse to the right of the Structure File (optional) field, then use the Open dialog box to navigate to and select the structure (.str) file that contains the layout.
  4. Click Open Shared (to open the file in read-only mode) or Open Exclusive (to open the file in edit mode).

    The file is displayed on its own tab in the main window.

  5. On the Search menu, click Find/Replace. The Find/Replace dialog box is displayed.
  6. To display the equivalent hexadecimal values of your find/replace criteria, select Hex.
  7. Do one of the following:
    • Find data in the file:
      1. Ensure that your keyboard is not in Overwrite mode; if it is, press Insert to toggle to Insert mode. If the Find field is blank, Overwrite mode will only allow you to enter text for a single character in length.
      2. In the Find field, click Down arrow, select one of the following input types, and then enter the find text into the field:
        • all - search each entire record.
        • in offsets - search a range of positions within each record. When you select this option, two additional fields are displayed in which you enter the offset to start searching and the number of positions on from that in which to search.
        • in field - (only available if the file is using a layout) search a particular field in each record. When you select this option, an additional field is displayed in which you select the field in which to search.
      3. Click Find Next to immediately jump to the first occurrence after the currently selected record, or click Find All to highlight all occurrences in the file.
    • Replace data in the file:
      1. Ensure that the file is in Exclusive mode: double-click The Switch to Exclusive Mode icon (Switch to Exclusive Mode).
      2. Input the Find criteria, as detailed above, and then enter the replacement text in the Replace with field.
      3. click Replace to replace the next matching text, or click Replace All to replace all matching text at once.

        An indicator showing the number of replacements is displayed.

    Note: If you are searching and replacing DBCS characters, you must use the Hex pane: select Hex, and then enter the hexadecimal values directly into the Hex pane.
  8. Click Close.