Classic Computer Magazine Archive ANTIC VOL. 8, NO. 2 / JUNE 1989

Super LOCATOR

Fast Multi File Text Finder

By Jeffrey Summers, MD


Ever try to find a specific bit of text when you forgot what file it was in? Save time and frustration by letting Super Locator do the searching for you. This BASIC program works on 8-bit Atari computers with 48K memory and a disk drive.

If you use your Atari 8-bit for word processing, sooner or later you will forget which file contains some vital piece of information. Previously, the only way to find that lost information was to load files one-by-one into your word processor, search for the desired phrase and if it wasn't in that file, move on to the next.

This very time-consuming process can make you wonder why you ever gave up your trusty typewriter to begin with. Now, Super Locator can make finding your text relatively painless. Super Locator will quickly search all the files on your disk for any specified string.

GETTING STARTED

To see how it works, type in Listing 1 and check it with TYPO II. Be sure to SAVE a copy to disk before you RUN it.

If you have trouble typing the spe cial characters in lines 10000-10030, don't type them in. Instead, type Listing 2, check it with TYPO II and SAVE a copy. When you RUN Listing 2, it creates these hard-to-type lines and stores them in a file called LINES.LST.

To merge the two programs, LOAD "D:LOCATOR.BAS"and then ENTER "D:LINES.LST" Remember to SAVE the completed program before you RUN it.

To use Super Locator, RUN the program and insert a disk with several word processing text files on it. Super Locator asks which files it should search, giving you the chance to narrow your search. Simply press (RETURN) to search all the files on the disk in Drive 1.

Entering a directory specifier limits the search and enables you to search the files on a different disk drive. The directory specifier is the same as you would use with DOS. For example, if all of the files you wish to search are on the disk in your second disk drive and end with the extender TXT, you would enter "D2:*.TXT".

If you could further limit this to files that started with the letter A, you would enter "D2:A*TXT". To check all of the files on Drive 2, enter "D2:*.*".

Next, you are asked for the string you want to find. This string may have up to 20 characters. The program also asks if the search should be case sen- sitive, distinguishing between upper case and lowercase letters. Although you can enter lowercase characters into the string, be careful to use only capital letters when answering other prompts.

End the string with [RETURN]. The program clears the screen and lists the names of the files it is checking as it goes along.

If the program finds your specified string, the string is displayed on the screen along with the text immediately preceeding and following it. This lets you check the context of the phrase you are searching for, to make sure that this is the instance you wanted to find.

For instance, if you were looking for a specific recípe for chocolate chip cookies, on a disk full of recipes, you could search for the string "chocolate". Your results might look like this:

CHECKING Dl:DOS.SYS
CHECKING Dl:AUTOMATETXT
CHECKING Dl:LETTER.DOC
CHECKING Dl:RECIPE.CPJ
Found in file Dl:RECIPE.CPJ
CHARLIE'S FAMOUS CHOCOLATE
CAKE THE
VING FROM PANS. CHOCOLATE
FROSTING
DIA & KEN'S MOCHA CHOCOLATE CHEESECAKE
ACKAGE SEMI-SWEET CHOCOLATE CHIPS

RECIPE.CPJ looks like a good place to look for that recipe. If you know the exact title of the recipe, you could specify "Toll House Cookies," instead. But if your search is too narrow, you risk missing your text because of slightly different wording, punctuation or spelling.

Each time the program finds the string, it will ask whether you wish to Continue searching (the program will continue to check that same file for another occurrance), move to the next file and continue the search, or stop (Exit). When the program has gone through all of the files specified on the disk, the program stops.

PROGRAM LOCATING

Super Locator does not distinguish between word processing files and programs. Thus, you can also use Locator to search a disk for a program that may use a particular prompt. You can look for anything in a quoted string or a BASIC REM statement. You can even search for text within machine language programs. The "context" may be meaningless in these instances, but the program will fiind the data in any case.

Rochester, New York physician Jeffrey Summers has written numerous usefiul programs for Antic, including Antic Data-X (Revision B appeared in the December 1988 issue) and Job Jar Atari (January 1989).

Listing:LOCATOR.BAS Download