Last Update:
Copyright ©: Circle Software


Searching:

The Pfind.js JavaScript file implements a key-word search of a standard Pfind file.

This means you can place as many key-words in the search criteria field as you want and each word MUST be on the same line of text to have a match. The words do not need to be in any special order.

Example:
Let's say we want to find all records with "record" and "2" on a line in the record. We would enter either: "record   2" or "2   record" into the search criteria box and click on the [submit] button. We should find ONLY the "This is record 2" record data, either the line, the address lines (explained below) or the entire record, all data between " * " lines.

A standard Pfind database file is as follows:
*
This is record 1 - file: DATA00.TXT
This is line one
This is line 2
This is line 3
*
This is record 2
This is line one
This is line 2
This is line 3
*<!--endOfList-->
This is my data form
I don't want people to search this part!
* ***end***end*** *
This database has only two records.

A key-word search means that all words entered into the key-word search field must be found on the present line. The key words do not have to be in an given order to find a match. To use more than one word for the key-words simply place a space between words in the search field.

The above <!--endOfList--> is optional - it can be placed on any line at any place. If it is in the file it will terminate searching at that location. If it is not present the search continues to the last line in the file.

The above * ***end***end*** * is NOT optional - it must be placed on the last line wanted. This is how the program knows that it has read all the data from the file. Consider it the EOF, End Of File, marker.

A Pfind HTML Text file is created like this:
<html><pre>
*
This is record 1 - file: DATA00.TXT
This is line one
This is line 2
This is line 3
*
This is record 2
This is line one
This is line 2
This is line 3
* ***end***end*** *
</pre></html>

Save it as a *.txt file and that's all there is to it.

If you did this:

<html><pre>
*
This is record 1 - file: DATA00.TXT
This is line one
This is line 2
This is line 3
@: MyEmail@MyComp.com
L: I Like to read
*
This is record 2
This is line one
This is line 2
This is line 3
@: none
L: I don't like anything
*<!--endOfList-->
This is record Three
This is line one
This is line 2
This is line 3
@: Jimmy@cone.com
L: I LOVE icecream!
* ***end***end*** *
</pre></html>

You would be able to page down and see record Three but you would never be able to search for matches beyond the marker.


Ouputs:


There are three types of outputs available in the Pfind.js implementation:

Full Record Output:
The output when searching for "record 2" in the above database will return:


This is record 2 This is line one This is line 2 This is line 3 @: none L: I don't like anything
Address Line Output:
An address line is any line without a ":" colon as the second character in the line. Any line with a colon is considered an information line, or in DB language a field line. The difference being that we can now separate the address lines from the other DB fields. So, the output when searching for "@: none" in the above database will return:

This is record 2
This is line one
This is line 2
This is line 3
Notice that there are no <HR> lines between records nor will there be the "*" between records. There will be one empty line between addresses so that you can cut and paste them into some other program for printing on labels if you want.

Single Matching Line Output:
If you had requested a line search on "@:" to get all the email addresses you would get:


@: MyEmail@MyComp.com @: none @: Jimmy@cone.com


Notice that between the lines there are no <HR> lines, no "*" lines and no blank likes. This is so you can cut and past into a text editor and arrange the lines anyway you want. For the email address lines you can remove the "none" lines then arrange what's left however your email sending program needs in order to send to everyone on this email list.