nemesis 0 Posted February 22, 2011 Report Share Posted February 22, 2011 Hi, I'm lost again, lol So I have a list with 29 URL's and I want to remove the last 9 URL's. I did it using "remove from list" 9 times and it's working but I'm sure there is a more elegant way to do it Any hints? Thanks! Quote Link to post Share on other sites
UBotBuddy 331 Posted February 22, 2011 Report Share Posted February 22, 2011 Hard to say without eyeballing the code but it sounds like you did pretty well. You can recreate the list and stop after Twenty. Quote Link to post Share on other sites
nemesis 0 Posted February 23, 2011 Author Report Share Posted February 23, 2011 Well, there is no code Just take some list and chop the last rows. I know I did it but what if I had to remove 100 lines, copy/pasting remove from list 100 times wouldn't be so cool I'm thinking maybe using while size of the list is greater that 20 do remove from list? Quote Link to post Share on other sites
Abs* 12 Posted February 23, 2011 Report Share Posted February 23, 2011 could you not loop the remove of list items if you had many to do ? Quote Link to post Share on other sites
theninjamanz 29 Posted February 23, 2011 Report Share Posted February 23, 2011 could you not loop the remove of list items if you had many to do ? LIST TOTAL LIST REMOVE LAST X ITEMS. SET X to a number. SET A LOOP TO ADD TO NEW LIST MAKE THAT LOOP BE A VARIABLE LIST TOTAL - THE VARIABLE SET TO X ITEMS. Quote Link to post Share on other sites
Psychotix 0 Posted February 23, 2011 Report Share Posted February 23, 2011 I dont quite get it ninjaman. This is what i've been doing and its not working lol. Add to listLoop 9 timesremove from list position of list-total Quote Link to post Share on other sites
theninjamanz 29 Posted February 23, 2011 Report Share Posted February 23, 2011 I dont quite get it ninjaman. This is what i've been doing and its not working lol. Add to listLoop 9 timesremove from list position of list-total I think it is the same thing I am saying but a different way around. Set the list total to a variable: so say the list is 100, the var will be 100. Then you want to remove the last X items which is another variable. Say you set this to 10. Then you do an add to list. inside a loop. Loop length is set to another variable which is LIST TOTAL Variable - X ITEMS variable. Quote Link to post Share on other sites
UBotBuddy 331 Posted February 23, 2011 Report Share Posted February 23, 2011 Check it out Just save this to a folder and create a file in that same folder with your 29 items. Then run it. You will then see how the remove process works.Remove-from-list.ubot 1 Quote Link to post Share on other sites
Psychotix 0 Posted February 23, 2011 Report Share Posted February 23, 2011 Tnx Ninjaman and Botbuddy! Edit: I tested it. Somehow the Eval function doesnt work.It doesnt reduce the listtotal by 20.It outputs a total of 20 list items. Quote Link to post Share on other sites
nemesis 0 Posted February 24, 2011 Author Report Share Posted February 24, 2011 Check it out Just save this to a folder and create a file in that same folder with your 29 items. Then run it. You will then see how the remove process works. Worked like a charm, awesome Thanks a lot man. 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.