Pazman 32 Posted February 14, 2013 Report Share Posted February 14, 2013 I was wondering if someone could possibly offer some insight (in detail) as to how I go about this.I really appreciate any help here cause I've been beating myself up on this for a few days List A) I have a list of 270 URLsList B ) I also have a list of 128 unique suffixes to add (the number in List B changes and can be larger or smaller than List A) So what I want to do is this: 1) Based upon the the TOTAL in LIST B = Randomly (possibly shuffle List A) and grab 128 URLs from List A2) Now Append to the end of the 128 URLs from List A the 128 suffixes from List B I know this is a form of concatenate BUT these are 2 unique lists that are scraped and I'm trying not to have to download to a file. I want to have the files concatenated within ubot while the program is running. List A will look like: http://cnn.com/http://foxnews.com/http://abc.com/http://cbs.com/http://nbc.com/ List B will book like: 225815989654 So in this example the output will look like: http://foxnews.com/2258http://abc.com/159http://cbs.com/89654So what has to happen is based upon the fact there are (3) in List B - Ubot will Randomly select only (3) from List A and then append the digits from List B to the end of list A ******Notes: Sometimes the List B will have a greater quantity and will have to RE-use List A until the complete List B is associated to a URL from List A I'm not wanting any duplicate from List A UNLESS List B is larger than List A Thanks so much! Quote Link to post Share on other sites
Sanjeev 46 Posted February 15, 2013 Report Share Posted February 15, 2013 (edited) Hello, check out the code below -This might be what you're looking for. As I Am quite new to Ubot - therefore the code is rather long - (and may not work in all the situations you mention above, but it should give you some ideas at the least.. add list to list(%ListA, $list from text("http://cnn.com/http://foxnews.com/http://abc.com/http://cbs.com/http://nbc.com/http://xyz.com/", ""), "Delete", "Global")add list to list(%ListB, $list from text("22581598965436586598", ""), "Delete", "Global")clear list(%AplusB)if($comparison($list total(%ListA), ">", $list total(%ListB))) { then { loop while($comparison($list total(%AplusB), "<", $list total(%ListB))) { add item to list(%AplusB, "{$next list item(%ListA)}{$next list item(%ListB)}", "Delete", "Global") } } else { loop($list total(%ListB)) { add item to list(%AplusB, "{$next list item(%ListA)}{$next list item(%ListB)}", "Delete", "Global") if($comparison($list position(%ListA), "=", $list total(%ListA))) { then { set list position(%ListA, 0) } } } }} Edited February 15, 2013 by Sanjeev 1 Quote Link to post Share on other sites
Pazman 32 Posted February 15, 2013 Author Report Share Posted February 15, 2013 I appreciate this and I will check it out! Thank you. 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.