© Matti Mattila, CPFA, CISA, CIA

10. Text Search Macro, 2:nd version (SEM2)

Previous Item Next item Previous menu
Functionality
Picture 1
SEM2.ISE is an improved version of text search macro than I made earlier (introduced here; SEMM.ISE). The macro introduced here is able to search and find string input by A user, in any text field of any IDEA database that the user selects.
The main properties of the macro:
- SEM2.ISS searches not only the input string as a whole. It searches also any part of the string exceeding three characters. E.g. if the string to be seached woould be "FINLAND", the macro could find e.g. following strings: "FINL", NLAND", and "AND".
- The strings found by the macro are shown in a table on display. Strings found in the same record are shown on the same row of the table. In addition results are written in a text file. It bears the name of the field that has been searched "_2.txt" added to its end. You can open (and edit) the file with e.g. Notepad. You can also import it to IDEA as a print file. The file contain 100 longest strings/string combinations.
- The searched string may exceed the length of the field where it is searhed for. So you can search for several strings at one time in the same field. If you are e.g. interested in Nordic countries, you can e.g. have a searched string NORDIC COUNTIRESFINLANDSWEDENNORWAYDENMARKICELAND".
- By choosing "Characters to Upper case" the macro changes all characters to upper case. They are written in uppercase in the text file *_2.txt, too. The original database remains unchanged.
Performance
The macro has better performance than its earlier version, especially when the string to be searched is long. The difference between versions in performance is illustrated below. The PC used in tests has Pentium 750 Mz processor and 512 RAM.
Picture 2
Picture 3
- Test 1. The file has 119 records, lenght of the field searched through is 115 characters, and the there are about 86,7 characters in the field on the average. Compared to SEMM.ISS SEM2.ISS needs 25-50 % less time to accomplish the same task (picture 2).
- Test 2. The file has 2739 records, lenght of the field searched through is 30 characters, and the there are about 7,1 characters in the field on the average. SEMM.ISS needs 0-35 % more time to accomplish the task than SEM2.ISS. When the string is longer than the lenght of the field where the string is searched SEM2.ISS has much better performance (picture 3).
Download You can download the demo version of SEM2.ISS (SM2.ISS) here. Its functionality is limited up to first 500 records.