Add List to Table As Column

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Example 1)
 
Line 26: Line 26:
  
  
[[File:add.jpg]]
+
[[File:addlttac.jpg]]
 
+
  
 
== Example 2 ==
 
== Example 2 ==

Latest revision as of 16:54, 22 October 2014

Add List to Table As Column is a Data Command.

This command inserts a list into a table at a specified location as a column.

Table: The table the list is being added to

Starting Row: The starting row where the list will be added to

Starting Column: The starting column where the list will be added to

List to Add: The list that is going to be added to the table.

[edit] Example 1

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


The script above will populate list %one, and then use the list to create one column in the table &test1. The table will be populated starting from column 0 row 0.


Addlttac.jpg

[edit] Example 2

Need to insert an item into a specific list position?

You can use the Add List to Table As Column 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