Searching for Text

Searching for Text

Throughout this manual you have seen references to searching for text and the fact that PCBoard supports Boolean operands. This section discusses how you enter the text to search for when you are at the Enter the Text to Scan for (Enter)=none prompt.

To begin with, you will be shown how to do some simple searches. From there, you will be shown how to do some more complex searches that involve Boolean operands.

Simple Searches

Single Word

The simplest search you can perform is the single word search. You enter the word to search for and PCBoard will search the criteria you have specified for that word. For example, if you are using the Z command, the file directories will be searched. If you are using the TS command, the message base will be searched.

For example, you may wish to search all messages in the current conference for the word monitor.
If so, type the following at a conference command prompt:

TS ENTER

Enter the Text to Scan for (Enter)=none? monitor R
Msg # to Begin Search from (1052-3904)? 1 R

At this point, the search begins for the word monitor. PCBoard will display any message that has the word monitor in it. While searching, PCBoard does not pay attention to the case of the word so it can be either upper or lower case and it will still be found.

Phrase

Taking the single word approach one step further, you can search for a phrase that consists of one or more words. If you find that searching for monitor finds to many matches and consequently was not being effective, you may decide to search for something more specific like vga monitor instead. This may help reduce the number of matches and help find the messages you are after.
This time, type the following at the conference command prompt:

TS <ENTER>

Enter the Text to Scan for (Enter)=none? VGA monitor <ENTER>
Msg # to Begin Search from (1052-3904)? 1 <ENTER>

At this point the search will begin again. However, this time, only messages which have the word VGA immediately followed by the word monitor will be displayed. When the message is displayed to you, PCBoard will highlight the match (f your graphics mode allows)so you can see where the match occurs.

Complex (Boolean) Searches

Boolean operands allow you to perform more complex searches than you would be able to perform searching for a word or phrase. With Boolean operators you can tell PCBoard to display a match only if it meets certain conditions you specify.

An expression is made up of an operator which acts on one or more operands.
With text searches, your operators are the Boolean operators. The operands are the word or phrases you are searching for. Do not over-burden yourself trying to remember the difference between operands and operators as you will find that the examples in this section will help you better understand the concept of Boolean text searching. The following discusses each of the Boolean operators.

& - The And Operator

The Boolean AND operator enables you to search in disjointed mode. In other words, both operands must exist in the target (message, file description, etc.) but they do not have to be in consecutive order. To help illustrate this, let's say you attempt to search for text editors that may exist on the system.

Because you have no idea what the filename is, you decide to use the Z user command to search for text in the file directories. When prompted for the text to search for, you enter text editor because that is what you are looking for. From there you begin the search which may list a fewprograms that may interest you.

The problem with this type of search is that you may have missed some files because you told PCBoard to find anything that had the text editor phrase in the description. What you may discover later when viewing file directories is the following file description:

TXED100.ZIP    168046  12-28-93  TexEdit v1.00 -- Utility you can use to
                               | edit any text file.  Supports VGA text 
                               | mode.  Includes mouse support.

Obviously, this looks like a file that you would be interested in. Why did this description not show in your previous search? Quite simply, nowhere in the description is the phrase text editor contained. Obviously your previous search is not catching all of the files you want to find.

This is not only where the Boolean AND operator becomes useful but also where it makes sense. If you had to sum up what you were looking for, you may say any file that can edit text. The italicized words are the key. You want to find any description which has both the word text and the word edit somewhere in the description. You do not know if the description will say something like “A utility to edit text” or if it will say “a wonderful text editor”.
Therefore, enter the following expression to search for:

TEXT & EDIT

The & in the search string represents the Boolean AND operator. If your translate the & into the actual word and it makes even more sense. This search would mean that you are searching for text and edit to be in the same description. It does not matter in what order, just simply that they occur in the description to become a match.

You can have as many Boolean operands as you wish in your search string. For example, you can enter the following search:

DISK & FORMAT & FLOPPY

This would search for the words DISK, FORMAT, and FLOPPY must all occur in order for a record to match.

| - The Or Operator

Like the Boolean AND operator, this operator enables you to search in disjointed mode. With this operator only one of the words or phrases need to be in the target (message, file description, etc.) to be considered a match.

As an example, you may wish to search the message bases using the TS user command for any message which talks about hard drives. You remember that some people call them hard drives and others may call them hard disks. In a case like this, use the OR operator to find any message that matches either phrase. Type the following Enter the Text to Scan for (Enter)=none prompt:

HARD DISK | HARD DRIVE

Any message that contains either the phrase hard disk or the phrase hard drive will be displayed to you.

! - The Not Operator

Sometimes you may not want to display all matching records. Instead, you may want to search all records which do not match the text you enter to search for. This is precisely the user of the Boolean NOT operator.

For example, you may want to search a directory that contains a bunch of GIF graphic images. All of the descriptions in this directory contain the resolution of the file. You decide that you do not wish to see the description of any pictures which are 320×200. If this is the case, type the following at the Enter the Text to Scan for prompt:

! 320x200

Any description which contains the phrase 320×200 will not be displayed to you because of the Boolean NOT operator ( ! ). Continuing on with the GIF examples, let's assume you want to see all pictures on the system that have a resolution of 1024×768 but you do not want to see any files that have swim in the description. If so, enter the following:

1024x768 &! SWIM

If you read that out in English it says 1024×768 and not SWIM. This would display all file descriptions that have a 1024×768 in the description (denoting the resolution of the picture) and that do not have the word SWIM anywhere in the description.

Using Parentheses To Group

Remember in mathematics how you used parentheses not only make your problems clearer and easier to understand but more importantly to control the order of operations to suit your needs? With Boolean operators you can do the exact same thing. If you take the example that illustrates using the AND Boolean operator one step further you can easily see how parentheses help group things together.

If you recall, you were using the AND operator to search for any description which contains both the words TEXT and EDIT. What happens if someone chooses to use the word ASCII instead of TEXT when they enter their description? To help you find this description, you can use parentheses to group items together.

This may result in the following search string:

EDIT & (TEXT | ASCII)

This will tell PCBoard to find any description that contains the word edit, and either the word text or the word ASCII. If you don not use the parentheses, PCBoard will evaluate from the left to the right. This means that it would only display files that contained both the words EDIT and TEXT or the word ASCII.

While it appears to be a very subtle difference, parentheses can make or break your search. Remember the easiest way to do Boolean searching is to read out the search in English.
If you look at the previous example which uses parentheses you could read it as follows:

EDIT and either Text or ASCII.

Including The Boolean Characters In Your Search

If you need to include any of the following characters in your search, use quote marks to prevent them from being interpreted by PCBoard's searching routine:

  • &
  • |
  • !
  • (
  • )
  • [space]

Obviously, these characters all have special meanings when involved in a search so you need some way of specifying them. For example, you may want to search for the phrase SMITH & JONES. If you type that phrase in as-is, the search will turn up anything with the word SMITH and the word JONES. What you would do in this case is to simply surround then entire search phrase with quote marks as illustrated in the following:

"SMITH & JONES"
sysops_guide/searching_for_text.txt · Last modified: 2024/01/18 14:58
CC Attribution 4.0 International Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution 4.0 International