Kreatus (Ubot Ninja) 422 Posted January 10, 2011 Report Share Posted January 10, 2011 This maybe very easy but I cant find on the forum how to do it.. For example I have this list: item1item2 item3 item4item5 How can I remove those empty lines? Thanks Quote Link to post Share on other sites
UBotBuddy 331 Posted January 10, 2011 Report Share Posted January 10, 2011 Two ways come to mind. Test the variable before adding to the list. If the items being added are truly unique then you could set the option to remove duplicates and that would remove all blank lines. But I still would test before adding to the list. Quote Link to post Share on other sites
Guerrilla 19 Posted January 10, 2011 Report Share Posted January 10, 2011 I ran into this problem, the tricky aspect of it is that when you delete a row all the other rows shift up. The way I did it was like this (it's quite robust way of doing it so i can use it for other situations) #listposition = ($list total - 1); Loop $list total { If ($list item == $nothing) { #remove rows += (list position + ",") } #listposition-- } This gets me a variable "#remove rows" with all the rows that need to be deleted. I then create a list from that variable with "add to list" and use the "," i added as the delimiter. I then loop over each list item and delete the row. The code above adds the highest list reference first so when you loop to "remove row" deleting the row doesnt effect the other row numbers. Quote Link to post Share on other sites
blackmaster 0 Posted February 23, 2011 Report Share Posted February 23, 2011 .ubot file sample please Quote Link to post Share on other sites
theninjamanz 29 Posted February 23, 2011 Report Share Posted February 23, 2011 .ubot file sample please Is there not a sort list option? Sort, then add to list and remove duplicates (in this case the spaces) Not tested, just going off a vague memory. 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.