<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6603.0">
<TITLE>RE: Fast Searches</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Now I better understand your datastructure & problem. Don't think it's necessary to delve into Valentina. Just try this:</FONT></P>
<P><SPAN LANG="nl"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">repeat for each line myline in mydata</FONT></SPAN><SPAN LANG="nl"><FONT FACE="Arial"> </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> add 1 to myArray [w</FONT><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">ord</FONT></SPAN><SPAN LANG="nl"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> 4 of myLine]</FONT></SPAN><SPAN LANG="nl"><FONT FACE="Arial"> </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">end repeat</FONT></SPAN><SPAN LANG="nl"><FONT FACE="Arial"> </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">put keys (myArray) into myList</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">put the number of lines of myList</FONT></SPAN>
</P>
<P><SPAN LANG="nl"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">It puts the number of different students into the message box</FONT></SPAN>
</P>
<P><SPAN LANG="nl"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Wil Dijkstra</FONT></SPAN>
</P>
<BR>
<UL>
<P><SPAN LANG="nl"><FONT SIZE=2 FACE="Arial">----------</FONT></SPAN>
<BR><SPAN LANG="nl"><B><FONT SIZE=2 FACE="Arial">From:</FONT></B> <FONT SIZE=2 FACE="Arial">metacard-bounces@lists.runrev.com on behalf of Ray Horsley</FONT></SPAN>
<BR><SPAN LANG="nl"><B><FONT SIZE=2 FACE="Arial">Reply To:</FONT></B> <FONT SIZE=2 FACE="Arial">Discussions on Metacard</FONT></SPAN>
<BR><SPAN LANG="nl"><B><FONT SIZE=2 FACE="Arial">Sent:</FONT></B> <FONT SIZE=2 FACE="Arial">Tuesday, January 11, 2005 18:32</FONT></SPAN>
<BR><SPAN LANG="nl"><B><FONT SIZE=2 FACE="Arial">To:</FONT></B> <FONT SIZE=2 FACE="Arial">Discussions on Metacard</FONT></SPAN>
<BR><SPAN LANG="nl"><B><FONT SIZE=2 FACE="Arial">Subject:</FONT></B> <FONT SIZE=2 FACE="Arial">Re: Fast Searches</FONT></SPAN>
</P>
<P><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">Thanks for such quick reponses!</FONT></SPAN>
</P>
<P><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">Each line of my data represents an elementary school student's answer </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">to a test question. The line has about 18 tab delimited items in it </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">(such as the question number, date it was answered, number of points </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">it's worth, whether the student got it right or wrong, etc). The 4th </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">item is the studnet's personal info and looks something like </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">Smith,John,William,12345. Each student has anywhere from 10 to 20 </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">lines of data, and the goal is to get a total count of how many </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">students there are.</FONT></SPAN>
</P>
<P><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">Richard's idea of the repeat for each structure is super fast, but I'm </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">having a hard time applying it here to get the total student count. I </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">think the best way is to delve into the Valentina data base idea. Any </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">suggestions on how to get started with this are very much appreciated.</FONT></SPAN>
</P>
<P><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">Thanks,</FONT></SPAN>
</P>
<BR>
<P><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">Ray Horsley</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">Developer, LinkIt! Software</FONT></SPAN>
</P>
<BR>
<P><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">On Tuesday, January 11, 2005, at 05:38 AM, Richard Gaskin wrote:</FONT></SPAN>
</P>
<P><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">> Ray Horsley wrote:</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">>> I'm working with large amounts of data, say 50,000 tab delimited </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">>> lines, where the 4th item in each line is the same for every 20 or so </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">>> lines. Does anybody have a fast way of determining how many unique </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">>> 4th items there are in the 50,000 lines?</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">>> A repeat loop examining each line is certainly out of the question, </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">>> and I've tried using various functions such as itemOffset after </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">>> sorting ascending and descending, but this too is turning out to be </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">>> kind of slow.</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">></FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">> I've had good luck using "repeat for each" on data sets up to 40,000 </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">> lines. Sure, there's a pause, but it's not so bad -- give it a whirl </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">> and you might be pleasantly surprised.</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">></FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">> -- </FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">> Richard Gaskin</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">> Fourth World Media Corporation</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">> ___________________________________________________________</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">> Ambassador@FourthWorld.com </FONT><U> <FONT COLOR="#0000FF" SIZE=2 FACE="Monaco"><A HREF="http://www.FourthWorld.com">http://www.FourthWorld.com</A></FONT></U></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">> _______________________________________________</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">> metacard mailing list</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">> metacard@lists.runrev.com</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">></FONT><U> <FONT COLOR="#0000FF" SIZE=2 FACE="Monaco"><A HREF="http://lists.runrev.com/mailman/listinfo/metacard">http://lists.runrev.com/mailman/listinfo/metacard</A></FONT></U></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">></FONT></SPAN>
</P>
<P><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">_______________________________________________</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">metacard mailing list</FONT></SPAN>
<BR><SPAN LANG="nl"><FONT SIZE=2 FACE="Monaco">metacard@lists.runrev.com</FONT></SPAN>
<BR><SPAN LANG="nl"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Monaco"><A HREF="http://lists.runrev.com/mailman/listinfo/metacard">http://lists.runrev.com/mailman/listinfo/metacard</A></FONT></U></SPAN>
</P>
<BR>
</UL>
</BODY>
</HTML>