Jump to content
UBot Underground

Most Efficient Way To Remove From List1 The Items In List2?


Recommended Posts

List1: 

 

google.com

newsweek.com

caller.com

washingtonpost.com

yahoo.com

facebook.com

cleveland.com

foxsports.com

 

List2: 

 

sportsnet.com

google.com

yahoo.com

thegaurdian.com

cleveland

mugshot

 

Entries removed:

 

google.com

yahoo.com

cleveland.com

 

-

 

What's the most efficient way to do this? Increment through list2 and loop some kind of if / regex statement on list one? 

 

 

 

Link to post
Share on other sites

if you want to do it with regex this is one way

clear all data
set(#list1,"google.com
newsweek.com
caller.com
washingtonpost.com
yahoo.com
facebook.com
cleveland.com
foxsports.com","Global")
set(#list2,"sportsnet.com
google.com
yahoo.com
thegaurdian.com
cleveland
mugshot","Global")
set(#output,$replace regular expression($replace regular expression(#list2,"\\b(?:{$replace regular expression(#list1,"\\r?\\n","|")})\\b",$nothing),"\\r?\\n\\s",$nothing),"Global")

note cleveland.com in list 1 and cleveland are not a match

  • Like 1
Link to post
Share on other sites

Use subtract lists:

add list to list(%list1,$list from text("google.com
newsweek.com
caller.com
washingtonpost.com
yahoo.com
facebook.com
cleveland.com
foxsports.com",$new line),"Delete","Global")
add list to list(%list2,$list from text("sportsnet.com
google.com
yahoo.com
thegaurdian.com
cleveland
mugshot",$new line),"Delete","Global")
add list to list(%list3,$subtract lists(%list1,%list2),"Delete","Global")
  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...