On Dec 9, 2012, at 12:33 AM, Glen Bojsza wrote: > I believe that this should be doable less than 1 second
Hi, Glen. Here's a draft you could try. It works for the sample data you posted. If you have questions, please ask. If you try it, please report your timings. -- Dick <postScript> function foo @pLines put the number of lines in pLines div 1000 into tGroupSize set the itemDelimiter to tab repeat for each line tLine in pLines add 1 to tLineNumber put item 2 of tLine into tValue if tIndex[ tValue ] is empty then put tLineNumber into tIndex[ tValue ] end if if tLineNumber is tGroupSize then put the keys of tIndex into tValues replace cr with comma in tValues put min( tValues ) into tMin put max( tValues ) into tMax if tIndex[ tMin ] < tIndex[ tMax ] then put tIndex[ tMin ] & tab & tMin & cr after tResult put tIndex[ tMax ] & tab & tMax & cr after tResult else put tIndex[ tMax ] & tab & tMax & cr after tResult put tIndex[ tMin ] & tab & tMin & cr after tResult end if put empty into tIndex put 0 into tLineNumber end if end repeat return tResult end foo </postScript> _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode