Roger Eller wrote:
global gCodes
put tList into tGood; put tList into tBad
put "PPX,RRY,NNZ" into gCodes
-- Keep lines that contain any item of gCodes
filter tGood with ("*" & item 1 of gCodes & "*") or ("*" & item 2 of gCodes
& "*") or ("*" & item 3 of gCodes & "*")
filter tBad without ("*" & item 1 of gCodes & "*") or ("*" & item 2 of gCodes
& "*") or ("*" & item 3 of gCodes & "*")

Perhaps I should just loop through each line checking if it 'contains' one
of the codes instead?

I would do that.

Regex is handy at times, but it's a complex subsystem and notoriously slow with complex operators.

I'll bet if you can first run a filter against the left-most column, a "repeat for each" on the remainder would likely be about as fast as you can get.

Sometimes "repeat for each" on the whole thing is faster than "filter".

--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 Follow me on Twitter:  http://twitter.com/FourthWorldSys

_______________________________________________
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

Reply via email to