zharfan 0 Posted April 11, 2014 Report Share Posted April 11, 2014 hello guys i need your help. i have list there are : best skin carebest skin care productsbest skin care products for menbest skin care products for women and then i will remove sentence less than 1, 2, 3, or 4. the example is if i will remove sentence less than 4 sentence. so it will be : best skin care products for menbest skin care products for women what is the command to do it ? thanks for your help Quote Link to post Share on other sites
Bot-Factory 602 Posted April 11, 2014 Report Share Posted April 11, 2014 Do you mean less that 4 words? Quote Link to post Share on other sites
a2mateit 395 Posted April 11, 2014 Report Share Posted April 11, 2014 You could add each line to a list individually. Use a space as the list seperator. Then do a comparison if the list total is less than 4, clear the list and loop to the next. If it is over 4 add them to a success list. There's probably an easier way to do this, but it's what I can think of off the top of my head. May try and post up some example code when I get back to my computer. Quote Link to post Share on other sites
UBotDev 276 Posted April 11, 2014 Report Share Posted April 11, 2014 You would approach that exactly as a2mateit said, I think that the easiest way... There is no UBot command/function that would do that for you out of the box. Quote Link to post Share on other sites
Pete 121 Posted April 11, 2014 Report Share Posted April 11, 2014 I would consider doing the reverse of what a2mateit said and just add the words to a listThis may stop it failing when other characters are included in the text clear list(%input) clear list(%output) add list to list(%input, $list from text("best skin care best skin care products best skin care products for men best skin care products for women", $new line), "Delete", "Global") loop while($comparison($list total(%input), ">", 0)) { set(#currentitem, $trim($list item(%input, 0)), "Global") add list to list(%check, $find regular expression(#currentitem, "\\b\\w+\\b"), "Don\'t Delete", "Global") if($comparison($list total(%check), ">=", 5)) { then { add item to list(%output, #currentitem, "Delete", "Global") } else { } } remove from list(%input, 0) clear list(%check) } set(#currentitem, $nothing, "Global") Quote Link to post Share on other sites
zharfan 0 Posted April 12, 2014 Author Report Share Posted April 12, 2014 thanks all for your answer. but i still confused. would you give me the example code ? because zap code is error when i tried Quote Link to post Share on other sites
zharfan 0 Posted April 12, 2014 Author Report Share Posted April 12, 2014 sorry zap i check again and then your code is right. thanks for you. and then would you all give me the example code else? 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.