Insert into Table

From UBot Studio
Revision as of 19:03, 8 September 2014 by LillyT (Talk | contribs)

Jump to: navigation, search

Insert into Table is a Data Command.

This inserts a blank row or column in front of a specified index (column or row number).

Table: refers to the table you would like to insert the column or row.

Insert: the drop down allows you to choose whether you want to insert a blank row or a blank column.

Index: refers to the position you want the row or column to be inserted. If an index of 1 is selected, and the insert is set to column, a blank column will be inserted for column 1.

Example 1

navigate("http://www.fruitsinfo.com/tropical-fruits.php", "Wait")
add list to list(%one, $scrape attribute(<href=w"http://www.fruitsinfo.com/*.php">, "innertext"), "Delete", "Global")
add list to table as row(&test1, 0, 0, %one)
plugin command("TableCommands.dll", "insert into table", &test1, "Row", 3)


Running the scripts will insert an empty row in the table above the populated row.


Insert.jpg


Example 2

Need to insert an item into a specific list position?

You can use the insert into table command to do just that.

navigate("http://listofrandomnames.com/index.cfm?generated", "Wait")
wait(6)
click(<type="submit">, "Left Click", "No")
wait(6)
add list to list(%names, $scrape attribute(<innertext=r"^(?<FirstName>\\w+)\\s(?<LastName>\\w+)$">, "innertext"), "Delete", "Global")
add list to table as column(&editing, 0, 0, %names)
plugin command("TableCommands.dll", "insert into table", &editing, "Row", 5)
set table cell(&editing, 5, 0, "Manny Su")
clear list(%names)
add list to list(%names, $plugin function("TableCommands.dll", "$list from table", &editing, "Column", 0), "Delete", "Global")


The position we want to insert the list item to is list position 5.

We then insert a blank cell, set the table cell value to the new value, which is the name Manny Sue, and then we clear the original list and create a new list from the edited table column

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox