I was going to give you the exact same code as Carl read, then saw his
suggestion  :-)

so I'll complement by giving you the fastest loop to clean-up a list of
lines.

and remember to use remove-each for the handling of the lines

;-----------------------
str:    [
    "Romeo loves Juliet very much"
    "I Don't love Romeo that much"
]
neg:    [ "cheese" "bread" "wine" "very" ]

remove-each item str [not empty? intersect neg parse item none]
;-----------------------

and remember that you can use read/lines on a text file to get the data in
the str format above.

so that would make it a 3 line script  :-D

-MAx

On Wed, Apr 22, 2009 at 2:23 AM, Carl Read <[email protected]> wrote:

>
> On Tuesday, 21-April-2009 at 19:13:58 Kai Peters wrote,
>
> >
> >Hi All ~
> >
> >I need to eliminate lines from a file that contain one or more words from
> a=
> > "negative" list.
> >Below is some simplified code showing how I am currently doing this. Is=
> > there a faster/better way?
> >
> >TIA
> >Kai
> >
> >
> >str:    "Romeo loves Juliet very much"
> >neg:    [ "cheese" "bread" "wine" "very" ]
> >strbl:  parse str none
> >
> >if (length? strbl) + (length? neg) > length? union strbl neg [ print
> "kick=
> > out" ]
>
> if not empty? intersect strbl neg [print "Kick out"]
>
> -- Carl Read.
>
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
>


-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to