pbsolution 4 Posted May 13, 2016 Report Share Posted May 13, 2016 Hello all together,i have a Question to all Ubot Users:I have two Lists, List1 and List2. I want to delete all Lines in List1 where the Url in List two is not in!Example List 1:Name,Email,Login,Password,URL (3000 Entrys)Example List 2:Only URL(500 Entrys Unique) So after Compare i want to have only 2 Lists with 500 Entry`s.I hope someone understand me. English is not my First language.Thanks Quote Link to post Share on other sites
pash 504 Posted May 13, 2016 Report Share Posted May 13, 2016 try.http://wiki.ubotstudio.com/wiki/$subtract_lists 1 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted May 17, 2016 Report Share Posted May 17, 2016 Subtract lists won't work in this case since he wants to keep the other information in tact. If you were to use it and the items don't match up identically then they won't remove them. So in this case we need to add the items to a table and then loop through comparing them one at a time. Unfortunately table search won't work in this case either since you want the exact match. I created an example on how to do this for you: You will need to modify this a bit, for example I only used 2 columns and you used 5 so inside of the loop -> loop -> if comparison change the $table cell column to be 4 Make sure you enable the Table Commands plugin for this: clear list(%big_list) clear list(%small_list) add list to list(%big_list,$list from text("1,http://google.com 2,http://yahoo.com 3,http://facebook.com 4,http://twitter.com 5,http://ubotstudio.com",$new line),"Delete","Global") add list to list(%small_list,$list from text("http://google.com http://twitter.com",$new line),"Delete","Global") clear table(&data) comment("Only use this command if the list is formatted like it is above with commas separating the values and lines separating the rows otherwise loop through to add in the values one by one") create table from text(&data,%big_list) loop($list total(%small_list)) { set(#next_item,$next list item(%small_list),"Global") set(#row_num,0,"Global") loop($table total rows(&data)) { if($comparison(#next_item,"=",$table cell(&data,#row_num,1))) { then { comment("DO NOT increment if you delete a row or you will get off track") plugin command("TableCommands.dll", "delete from table", &data, "Row", #row_num) } else { increment(#row_num) } } } } Quote Link to post Share on other sites
deliter 203 Posted May 18, 2016 Report Share Posted May 18, 2016 the table search function is pretty good for this type of thing add list 1 to a table, loop through list 2,if an item is not found do nothing,if it is found,add it to a new list,so list 3 in your above example would be 500 *EDIT* didnt really understand the question,credit to HInsomnia for getting it add list to list(%one,$list from text("1 2 3 4 5",$new line),"Delete","Global") add list to list(%two,$list from text("4 5 6 7 8",$new line),"Delete","Global") add list to table as column(&myTable,0,0,%one) loop($list total(%one)) { set(#nxtItem,$next list item(%two),"Global") if($comparison($plugin function("TableCommands.dll", "$table search", &myTable, #nxtItem, "Row Index"),">","-1")) { then { add item to list(%three,#nxtItem,"Don\'t Delete","Global") } } } Quote Link to post Share on other sites
pbsolution 4 Posted May 18, 2016 Author Report Share Posted May 18, 2016 Hello,thanks for this great Solutions. Im on Mobile now, i will test them later.Thanks Quote Link to post Share on other sites
ambrast 1 Posted June 3, 2016 Report Share Posted June 3, 2016 Hello pbsolutionIm from Germany-Wenn Du dich mal austauschen magst melde dichHave a nice day Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.