Jump to content
UBot Underground

How to remove last 9 rows from list?


Recommended Posts

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 :D and it's working but I'm sure there is a more elegant way to do it :) Any hints? Thanks!

Link to post
Share on other sites

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 :D

I'm thinking maybe using while size of the list is greater that 20 do remove from list?

Link to post
Share on other sites

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.

 

:)

Link to post
Share on other sites

I dont quite get it ninjaman.

 

This is what i've been doing and its not working lol.

 

Add to list

Loop 9 times

remove 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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...