Search is a powerful tool that can be used to search and optionally replace fields within the currently loaded x9 file on a record by record and field by field basis. Search differs from Find in several ways: •Search is designed to search the entire x9 file on a record by record, field by field basis, while Find is designed to search only for items (debits or credits).
Search allows values to be replaced while Find does not.
Find can build a filter of the located items, while search cannot since it is x9 record oriented (and not items oriented as represented by Find).
Search String Entry
Search strings can be entered using one of several available options:
- Actual value comparison (against each individual field value within each x9 record) using your entered search string. In this mode, there are two options that can be applied to assist in your search efforts:
- Compare numeric fields on a logical value basis; enabling this option will remove leading zeros from numeric fields as part of the evaluation process (eg, a search string of “1” will match an x9 field that contains “00001”).
- Compare alpha fields on an upper case basis; enabling this option will evaluate alpha fields using their upper case values, which would normally always be applied for x9 searches.
- Select all fields which contain blanks; these are typically conditional fields that are not populated with a value.
- Select all fields regardless of value; this option must be used in conjunction the Field Selection panel. For example, this would allow you to select all Bundle Business Dates which you could then replace with an alternate value.
- Compare on a contains value basis; a match is signaled when your entered string value appears anywhere within the string of characters for a given x9 field.
- Compare on a leading value basis; a match is signaled when your entered string value appears as the leading string of characters for a given x9 field.
- Compare on a trailing value basis; a match is signaled when your entered string value appears as the trailing string of characters for a given x9 field.
- Compare on a RegEx basis (read on for a further explanation) where your search string is used as a RegEx expression against each x9 field; a match is signaled when evaluation of the RegEx expression results in a true value.
Replace String Entry
Replacement strings can be entered using one of several available options: •On an actual value basis where you enter the actual replacement string to be assigned to each field. The new value can be purposefully blank, in which case you will be queried to confirm that you in fact do want to replace the current value with spaces.
- On an actual value basis, where you enter the replacement string and an increment to be assigned to each field. For numeric or numeric blank fields, the increment is repetitively added to the values allowing them to be sequentially assigned. For string based fields, the increment is instead treated as a suffix which is appended to the end of the value string. In this situation, you can also control the minimum length of the suffix by entering leading zeros. For example, a value of “ID” with an increment of “0001” will assign string values of “ID0001”, “ID0002”, “ID0003”, etc.
- On a substring basis, where the replacement string is used to replace the first located occurrence of the search string within the current field value.
- On a substring basis, where the replacement string is used to replace every located occurrence of the search string within the current field value.
Search allows you to identify the specific fields that are to be searched within the current x9 file. The default is to search against all fields across all record types. You can use the field selection panel to limit the search to specific record types or specific fields using the provided check boxes.
To select all fields within a given x9 record type, you must select the “xx.1” check box for that specific x9 record type. For example, to select all fields within the type 25 record, you would select the “25.1” check box which will then automatically check all fields that exist for the check detail record type.
You can alternatively select on a field by field basis. This is a powerful option since it allows you to perform a very targeted search against one or more fields of your selection, by scrolling through the provided list and using the provided field level check boxes.
Available actions are as follows:
- Search: initiate a new search using the current search string and options
- Next: advance to the next hit with the current search list
- Replace: replace the current hit with the replacement string
- Replace/Next: replace the current hit with the replacement string and advance to next
- Replace All: replace all remaining hits with the replacement string
Use of the Modify Log
Search/Replace is integrated with the Modify Log, with each field replacement being logged there as a modified field just as though you used Modify to actually make the change. This design allows use of Modify (from the tool bar) to review all changes that are made using Search/Replace. Modify can then also be used to launch or even revert individual changes. The Modify Log can be printed to PDF or exported to Excel, providing a full audit trail of your changes.
Remember that x9 files are actually stored by X9Assist within available memory and are not actually created (written) until you save to an external file. Hence you can always decide to NOT save your changes and hence any replacement actions will be lost. When saving files, you should always write to a new file name and not overwrite your input x9 file.
What is RegEx? Per Wikipedia: “In computing, a regular expression is a specific pattern that provides concise and flexible means to “match” (specify and recognize) strings of text, such as particular characters, words, or patterns of characters”. A full RegEx tutorial is beyond the scope of this document.