Is it possible to delete/add multiple row from a table or copy part of a table?

I am looking at Add/Remove Row action and wondering if it is possible to delete multiple rows. Is it possible and what would be the function/format if it is? For example range(1,100) or 1,100 neither of these work but does anyone know of something that does?

I have a table with 20,000 rows and 17 Columns and I want to work with 200 to 1,000 row chunks of it at a time. I am thinking I can either;
1. Copy the table and delete the unwanted rows
2. Copy the chunk I need

I can't see a quick efficient way to do either of these, any help would be appreciated.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I would use a Loop over Table behavior in the nightly build to copy the rows you want to a new table and work on the data there. Is there a reason you need to have those rows separate from the main table? Is it because you're using tableRowCount, or some other reason?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • colandercolander Member Posts: 1,610
    @tatiang I tried a loop for a search of a 1,000 rows and it was way too slow so I didn't even try looping to copy it.

    I am creating an app which will display table data. I would like to import one large table with all events in it as opposed to 100 or so small tables for each event. I am doing something along the lines of "Stormys GS Table-izer" to display it. I have coded it to find the first and last rows of any event the users chooses. Now I need to decide the best way to go.

    The table will be regularly imported replacing old events. The data will be changed by the user depending on local factors. I could do everything on the imported table or a copy of it. But I thinking copying the event the user chooses to another table which will be discarded/overwritten when the user is finished with it and chooses a new event would be easier to code and more efficient.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    You're right, Loop over Table is really slow. I just tried it out and it took too long with even 300 rows. On the other hand, the new tableSearch() function is nearly instantaneous with 3000 rows.

    Edit: same speed with 88,000 rows of names. It found the location of the last one in less than a second (official documentation states that it takes less than 0.01 seconds to do a search this large)!

    I guess I just don't see the purpose of moving everything to a separate table when you can use a row index (integer attribute) to know where to start and end your table data for that event. It seems like extra hassle, but then I don't really have a sense of your game.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • colandercolander Member Posts: 1,610
    edited February 2014
    @tatiang Yes tableSearch() is lightning fast I tried it on a 20,000 row table using four tableSearch() functions in two rules and it found both the first and last rows of the second last event instantaneously.

    The app I am trying to create is a business app not a game and I not even sure it can be done in GS but it looks promising so far. I think you are right working on the main table and not copying an event is the way to go. Still it would be nice to have the ability to add or delete multiple rows/columns at a time and copying part of a table instead of the whole table. It would open up GS a lot more for other things besides games.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I agree with you and recommend that you post a feature request.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.