Searching data on more than 1 files and or more than 1 fields 
Author Message
 Searching data on more than 1 files and or more than 1 fields
Hello, I would like to know how to search data on more than 1 files at the
same time.
ex: I have 5 files "a,b,c,d and e", each file contains 5 fields "aa,bb,cc,dd
and ee"
I would like to find the word X in each file in field aa or bb.


Thu, 31 Jul 2003 18:09:01 GMT
 Searching data on more than 1 files and or more than 1 fields

Carlos,

You must hard code the searches separately in each file, although the
overall search can be called by one script in one file.

If you want to search for the string "Henri" in fields aa, bb, cc, dd, an ee
in each file, you must create a script in each file, with each script using
a separate step for each find. In each file, create a global text field,
"gSearch", to hold the string.

The overall script, in the starting file, would use its own global field,
"gSearch". On a layout, enter the string ("Henri") into the global field
gSearch.

The main script would read something like:

Set Field["File b relationship::gSearch", "gSearch"]
Perform Script[Sub-script, External: "File b"]

Set Field["File crelationship::gSearch", "gSearch"]
Perform Script[Sub-script, External: "File c"]

Set Field["File drelationship::gSearch", "gSearch"]
Perform Script[Sub-script, External: "File d"]...etc

Go to Field

The local (sub-scripts) would be:

Set Error Capture (on)
Enter Find Mode[]
Set Field["Field aa", "gSearch"]
Perform Find[]
(other stuff, dealing with empty results, etc.)

Set Error Capture (on)
Enter Find Mode[]
Set Field["Field bb", "gSearch"]
Perform Find[]
(other stuff, dealing with empty results, etc.)

Set Error Capture (on)
Enter Find Mode[]
Set Field["Field cc", "gSearch"]
Perform Find[]
(other stuff, dealing with empty results, etc.)...etc.

Notice, at the end of the first set of script steps in the overall script,
the step Go to Field (you don't need to specify a field). That step, or any
other local executed step (Go to Layout, Exit record, Go to Record, etc.) is
necessary to return focus to the first file. Otherwise, you will end up in
the file where the last search is conducted.
--
John Weinshel
Datagrace
Associate Member, Filemaker Solutions Alliance
Vashon Island, WA
(206) 463-1634


Quote:
> Hello, I would like to know how to search data on more than 1 files at the
> same time.
> ex: I have 5 files "a,b,c,d and e", each file contains 5 fields
"aa,bb,cc,dd
> and ee"
> I would like to find the word X in each file in field aa or bb.



Fri, 01 Aug 2003 01:18:38 GMT
 Searching data on more than 1 files and or more than 1 fields
There are two aspects to this. First, you have to execute the search.
Second, you have to display the results somehow.

The trick I'd use is, I wouldn't even do a Find! How's that? Glad you asked.

In each file to be searched, create one global text field, gTerm and one
calculation field (text), gMatch.  The calculation is:
If(PatternCount(SearchField1, gTerm)+PatternCount(SearchField2, gTerm) > 0,
gTerm, "")

It's easiest to explain this the way I would do it, with a "dummy" file that
I use as the application starting point and as a place to stash variables,
but with no real data records. Have the user enter the search term ito a
global field, gSearch, in that file. With scripts, (SetField) set the value
of gTerm in every file to be searched, making it equal to gSearch. That will
place the search term in gMatch for every record where one or the other
search field has a match. Then, have a relationship from gSearch in the
dummy file to gMatch in every searched file. Create a portal on the screen
for every searched file.

That's it. A find without a find, using relationships instead. This is
better than a find in every file because it gives you a clean way of
displaying the results.

mark


Quote:
> Hello, I would like to know how to search data on more than 1 files at the
> same time.
> ex: I have 5 files "a,b,c,d and e", each file contains 5 fields
"aa,bb,cc,dd
> and ee"
> I would like to find the word X in each file in field aa or bb.



Fri, 01 Aug 2003 01:35:46 GMT
 Searching data on more than 1 files and or more than 1 fields
I think Mark's method is a better way, as it does deal with how to view the
results, which I had not thought about adequately.

John


Quote:
> There are two aspects to this. First, you have to execute the search.
> Second, you have to display the results somehow.

> The trick I'd use is, I wouldn't even do a Find! How's that? Glad you
asked.

> In each file to be searched, create one global text field, gTerm and one
> calculation field (text), gMatch.  The calculation is:
> If(PatternCount(SearchField1, gTerm)+PatternCount(SearchField2, gTerm) >
0,
> gTerm, "")

> It's easiest to explain this the way I would do it, with a "dummy" file
that
> I use as the application starting point and as a place to stash variables,
> but with no real data records. Have the user enter the search term ito a
> global field, gSearch, in that file. With scripts, (SetField) set the
value
> of gTerm in every file to be searched, making it equal to gSearch. That
will
> place the search term in gMatch for every record where one or the other
> search field has a match. Then, have a relationship from gSearch in the
> dummy file to gMatch in every searched file. Create a portal on the screen
> for every searched file.

> That's it. A find without a find, using relationships instead. This is
> better than a find in every file because it gives you a clean way of
> displaying the results.

> mark



> > Hello, I would like to know how to search data on more than 1 files at
the
> > same time.
> > ex: I have 5 files "a,b,c,d and e", each file contains 5 fields
> "aa,bb,cc,dd
> > and ee"
> > I would like to find the word X in each file in field aa or bb.



Fri, 01 Aug 2003 04:35:39 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Looking for seach tool to search HTML files and limit search based on fields

2. Write ADO Field containing binary data (files) to the file system

3. Searching dBase files by date field

4. Search Engine wanted for alphanumeric field data

5. searching for keywords in a text data type field on sql server

6. Boxes with a data control field - search?

7. Searching data in MEMO fields.

8. Searching for MEMO field data

9. full text search on a access text data field

10. Need to search for data in any Field

11. searches in long data field

12. Need Help: search/replace data in one field/one record, by queries or script: PDOX5


 
Powered by phpBB® Forum Software