blacksabbath 2 Posted June 6, 2014 Report Share Posted June 6, 2014 Hello all, I have pulled a list of names using the scrape attribute function but in my list the names appear with a lot of spaces in them for example John (spaces after too) Mike Sally Carol My question is how can I remove all the spaces then use this list as a comparison to say if List item = Mike then do this... Thank you Quote Link to post Share on other sites
pash 504 Posted June 6, 2014 Report Share Posted June 6, 2014 try add list to list(%data, $list from text($replace regular expression(" John Mike Sally Carol", " ", ""), $new line), "Delete", "Global") 1 Quote Link to post Share on other sites
Gogetta 263 Posted June 6, 2014 Report Share Posted June 6, 2014 You might also want to take a look at the $trim function. http://wiki.ubotstudio.com/wiki/Trim Quote Link to post Share on other sites
UBotDev 276 Posted June 6, 2014 Report Share Posted June 6, 2014 I also think trim is a better option, since it won't remove spaces between 2 words that are actually 1 list item. 1 Quote Link to post Share on other sites
cicooboom 0 Posted June 7, 2014 Report Share Posted June 7, 2014 Try this: add list to list(%data, $list from text($replace regular expression(" John Mike Sally Carol", " ", ""), $new line), "Delete", "Global")plugin command("File Management.dll", "remove all from list", %data, "^\\s*$") Quote Link to post Share on other sites
blacksabbath 2 Posted June 9, 2014 Author Report Share Posted June 9, 2014 Thank you for all the replies, got it working!Wasn't too sure how to use the Trim function! 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.