Menu

TheEditor

Les Ferguson
Attachments
qvedit03.gif (29664 bytes)
qvsearch01.png (16759 bytes)
qvsearch02.png (19033 bytes)
qvview03.gif (80156 bytes)

The Editor

The currently opened file has its full pathname displayed at the top of the message display area. The segments are loaded into the tree-view as top-level nodes. Each node in the tree displays a reference to the segment, field, repeat index, and component index, as applicable. This is followed by the raw data for the element. Expand a node to get a breakdown of the element.

When you select an element in the tree-view and there is schema documentation available for it, the documentation will be displayed in the info panel at the the bottom of the window.

Right-click on any node in the tree-view to get a context-menu, which has options to Edit or Copy the element data. Copy just puts the data from the selected element in the clipboard. The Edit option, when available, opens the text editing box.

Double-clicking an element on the tree view has two different actions: if the element has child elements, double-click toggles the node open or closed. If the element has no children, double-click will open the edit box for that element.

Be careful how you use message delimiter characters when editing, I have allowed total freedom in what can be done here, e.g. you can insert or remove field-markers, repeat-markers and component-markers, allowing you to add or remove elements, thereby moving other elements out of their correct position. However, you can not insert or delete segments, for now. Those functions have not yet been added.

Note, when editing an element that contains repeat-markers, the text edit box will show a line break after each repeat-marker. You can also break lines using ctrl-enter, if it helps with editing large text strings. The line breaks will however be stripped from the value when it is saved back into the segment.

After you have edited an element in the file, an indicator will show that changes have been made to the file. This is a blue 'Save Changes' label, to the left of the file name. You can save the file by clicking on this indicator label, by pressing Control+S, or via the menu options File Save or File Save As. If you attempt to open another file without saving your changes, you will be prompted to save the changes first; select Yes to save, No to discard changes, or Cancel to cancel the action you have just taken and keep the current file loaded.

Search and Replace

The Search menu item has options Search/Replace and Find Next, also accessible via hotkeys control-F and F3. These commands open the Search and Replace dialog, which behaves in a similar manner to Find/Replace actions in a text editor, except for the limitations of the tree structure. The search steps through each segment, starting at or after the segment currently selected in the editor.

The search will step down to the smallest element it can get to, and when a match is found the element will be selected and highlighted in the editor tree. The limitations on where the search will stop are:

  • If your search value contains a field marker, the search and replace actions will only be applied to the segment.
  • If the search value does not contain a field marker, the search will step down into each field.
  • If the search value contains a component or repeat marker then the search will stop at the field.

Search value with component marker - stops at field level:

Search value with no message delimiters - stops at component level:

When a search has been performed and the matched element is selected in the editor, you may click on Replace to replace the searched value with a new value. After clicking Replace a find-next is performed, so you may click Replace multiple times to replace more than one matching value.

Warning: the same freedom of action is available in Search/Replace that you have when editing a value; you may add or remove message delimiter characters, thereby altering the structure of the message. For example if your replacement value contains field markers, you may be pushing other fields out of their current position in the segment. This is allowed and relies on your visual validation of the outcomes.


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.