Multi-level filtering question

Jan Schenkel janschenkel at yahoo.com
Mon Jan 12 06:20:21 EST 2004


--- nc <ncouch at mail.airmail.net> wrote:
> I have a database which I have extracted a finite
> set of attributes 
> from (call them A,B,C, and D).  They are output as
> four lines of text 
> for each record, for example:
> 
> 	AttributeA: DN=Smith,
> John,OU=Users,DN=domain,DN=Com<CR>
> 	AttributeB: MTA=MSEXC210<CR>
> 	AttributeC: MDB=MSEXC210,Server=MSEXC212<CR>
> 	AttributeD: MailAddress: Jsmith at domain.com<CR>
> 
> I have been able to filter on any one of these
> attributes without a 
> hitch.  Even better since the database I am querying
> against can be 
> several hundred MB in size the filter query is very
> fast, oftentimes 
> taking less than a minute to extract for the query. 
> The queries for 
> this same job without the filter function took over
> 45 minutes in some 
> cases so thank you developers!
> 
> Anyway, getting back to my question.  What I would
> like to do is filter 
> for multiple aspects of each record (assuming
> several thousand records 
> and each record having four lines with each line
> ending with a CR).  I 
> have been able to run a multi-level filter against
> the database and 
> that works great, but what I have not been able to
> solve yet is to run 
> the multi-level filter and have it extract all four
> lines of the 
> record.  Going back to the entry above, say I wanted
> to do a query that 
> would find all records where AttributeB:
> MTA=MSEXC210 AND where 
> AtrributeC: MDB=MSEXC210,Server=MSEXC212 were
> present then pipe all 
> four lines of each record that fit the criteria out
> to a text file or 
> output field.
> 
> I hope this is clear as to what I am trying to
> accomplish.
> 
> If you have any questions please let me know.
> 
> Regards and thanks.
> 
> Nate
> 

Hi Nate,

My suggestion would be to pump the data into an array
first.
--
set the itemDelimiter to ":"
put empty into tArray
repeat for each line tLine in tData
  add 1 to i
  put i MOD 4 into tIndex
  put item 1 of tLine into tAttribName
  put item 2 to -1 of tLine into \
      tArray[tIndex,tAttribName]
end repeat
--

Now you should be able to build more arrays and filter
the data, saving the index in the complete array, so
you can fetch all the corresponding data in the other
attributes.

If you need more info, feel free to post here.

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus


More information about the use-livecode mailing list