Luke 18 Posted February 13, 2011 Report Share Posted February 13, 2011 Hey fellow botters; got a puzzle for you today. I've been working with a Table that I want to compile a Keyword List out of. It looks like a longer version of this: It doesn't have to be a &table, it could be 3 separate %lists instead... But either way what I'm trying to wind up with is a single %list that combines the first two columns, both apart and together, with the 3rd column, all in a big list. So here is the exact output I'm looking for in this case: WidgetCogSprocketNew WidgetNew CogNew SprocketUsed WidgetUsed CogUsed SprocketRed WidgetRed CogRed SprocketBlue WidgetBlue CogBlue SprocketGreen WidgetGreen CogGreen SprocketOrange WidgetOrange CogOrange SprocketBlack WidgetBlack CogBlack SprocketNew Red WidgetNew Red CogNew Red SprocketNew Blue WidgetNew Blue CogNew Blue SprocketNew Green WidgetNew Green CogNew Green SprocketNew Orange WidgetNew Orange CogNew Orange SprocketNew Black WidgetNew Black CogNew Black SprocketUsed Red WidgetUsed Red CogUsed Red SprocketUsed Blue WidgetUsed Blue CogUsed Blue SprocketUsed Green WidgetUsed Green CogUsed Green SprocketUsed Orange WidgetUsed Orange CogUsed Orange SprocketUsed Black WidgetUsed Black CogUsed Black Sprocket -So Row 2 (3rd row) is used in every keyword combination, but the other rows are not used every single time. The rows are also not equal lengths. I would imagine that there is a way to do this using either &table rows or lists, that use $next list item in a loop, to combine the words together, but the usage escapes me. And how can we make it so Row 2 is always used but Rows 0 and 1 aren't used in every keyword? Confusing. Help! Quote Link to post Share on other sites
UBotBuddy 331 Posted February 13, 2011 Report Share Posted February 13, 2011 I think you can do it in three loops. I will think on it so I might pop up an example. Quote Link to post Share on other sites
Luke 18 Posted February 14, 2011 Author Report Share Posted February 14, 2011 I think you can do it in three loops. I will think on it so I might pop up an example.Thanks Buddy! I'll try working with three loops now and see what I can come up with now too. Just to expand on what you said though; the three loops are for the three rows, right? So If in reality my script is 9 rows, I need 9 loops, right? Cheers,Luke Quote Link to post Share on other sites
UBotBuddy 331 Posted February 14, 2011 Report Share Posted February 14, 2011 No. One loop will repeat 2 times. Another one loops 5 times and the last loop will repeat 3 times. I hope to have some soon. Quote Link to post Share on other sites
UBotBuddy 331 Posted February 14, 2011 Report Share Posted February 14, 2011 Luke, Save this bot to a folder then run add New & Used in the Status box separated by a comma, Then add you colors to the Colors text box and separate them with a comma. In the Product box add your Widget, Cog and Sprocket and separate then with a comma. Then run the bot. A text file will be created. It's not perfect, in fact, three items are missing. I will try to debug the code but at least you will see where I was going with the Three loops i was talking about.Keyword-List-Builder.ubot 1 Quote Link to post Share on other sites
Luke 18 Posted February 14, 2011 Author Report Share Posted February 14, 2011 Awesome Buddy, Thank you! It works very well. It's not perfect, in fact, three items are missing. I will try to debug the code but at least you will see where I was going with the Three loops i was talking about. Hmm, I see what you mean about the 3 missing. -I wonder how that happened... Perhaps my example had 3 repeats in it somehow? Anyway It's what I needed to build from so thanks again. I was making it to hard as usual, mucking around with a table... Quote Link to post Share on other sites
Luke 18 Posted February 14, 2011 Author Report Share Posted February 14, 2011 Hmm, I found the missing 3: new widgetnew cognew Sprocket It got the used ones, just not the new ones somehow... Likely you're just missing another "set list position" in the final loop or something... Thanks again! Quote Link to post Share on other sites
UBotBuddy 331 Posted February 14, 2011 Report Share Posted February 14, 2011 I am going to tweak with it some more as I do not like logic that is not complete from me. lol Quote Link to post Share on other sites
UBotBuddy 331 Posted February 14, 2011 Report Share Posted February 14, 2011 Luke, Check this out. This one absolutely correct! EDIT! Dang it I just found a flaw. *^%&$*&(**^%$% Quote Link to post Share on other sites
UBotBuddy 331 Posted February 14, 2011 Report Share Posted February 14, 2011 OK! Now let's try it again. LOL Quote Link to post Share on other sites
Luke 18 Posted February 15, 2011 Author Report Share Posted February 15, 2011 OK! Now let's try it again. LOLWill do... Once you post it! Quote Link to post Share on other sites
UBotBuddy 331 Posted February 15, 2011 Report Share Posted February 15, 2011 Whoops! I thought I did. Here ya go.Keyword-List-Builder-2.ubot Quote Link to post Share on other sites
Luke 18 Posted February 15, 2011 Author Report Share Posted February 15, 2011 Much better! It is getting them all perfectly now, and I much prefer the ordering this way. Thanks a bunch, I can take it from here. Now I'm off to make conditionals like "if no Color variable exists, run it as two combiniations instead of three"... Should be fun. Oh yeah, & i'm going to expand it into 6 Keyword blanks instead of three! Six nested loops, all conditional except for the Product. Should be fun, don't you think? Thanks again,Luke Quote Link to post Share on other sites
Hung Le 0 Posted April 29, 2013 Report Share Posted April 29, 2013 it's magical! This is exactly what I'm looking for! Thank you very much! You guys rocks! 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.