Jump to content
UBot Underground

Recommended Posts

What is the best way to take one comma separated variable and turn it into multiple different variables.  Essentially I am running a csv file to show tempVar as next list item but not every list item has the same number of columns.

 

This is what I have

 

CSV Contact list

tom,555-555-5555,123 Test Street Dallas Texas, testwebsiteurl.com

sally,666-666-6666, 118 Test Drive Daytona Florida, (no website)

hank, 111-111-1111, 5454 Test Ave Seattle Washington, (no website)

linda, 222-222-2222, 432 Test Lane Denver Colorado, lindaswebsiteexample.com

 

 

This is what I am trying to do

 

add list to list{contactList}{list from file .csvfile}

 

loop total contactList

 

     set tempVar {next list item {contactList}}

     separate tempVar into nameVar,phoneVar,addressVar,webVar(if it exist)

     perform task

 

Link to post
Share on other sites

Make your life easier and read this as UBot table.

 

Once you'll have table loaded, 1st column will always be name, 2nd one phone, .....

 

Then just increment row and you'll get through csv that way.

Link to post
Share on other sites

How do you set a csv to table?  I am still new to ubot and haven't really used tables.  This definitely sounds easier.

Link to post
Share on other sites

Ok, set everything up as a table.  Much better.  Now from here, is there some type of Next Cell or Next Row command just like in a list?  Like "next list item" but for tables.  Do I need to convert the table into separate list or is there a better way to do this?  Thanks for all the input.

Link to post
Share on other sites

You can refer to data in a table cell, specifically.

 

As with lists, it is always better to refer directly the element, rather than indirectly... in other words, do not use $next list item, but $list item instead.

 

To do so, you will have to loop through the list, using an indexing counter (of elements = rows in the case of lists, or in case of tables, either rows OR columns)

Lists are, basically tables, but with a one dimension (a single row of data)

 

So to access a table cell, you will need a looping indexing variable for looping the rows OR columns, whichever you prefer, in the first place, then a second variable, to point to the other dimension (rows -> cols, or cols -> rows, respectively) to pinpoint the specific cell.

 

Hope this helps...

Link to post
Share on other sites

I tried that but I keep getting errors.  Essentually I have......

 

loop{table total rows}

 

type text

text area

Text to Type: Table Cell {list} Row {counterVariableincreases} Column 1

 

Getting Script Error string to integer.  Does the "table cell" row and column store names or positions?  Should be position on table right?

Link to post
Share on other sites

I think you are trying to use string as column or row #. why do you use list there?

 

use the code bellow:

type text(<tagname="input">, $table cell(&table, #ROW, 1), "Standard")

and make sure that variable #ROW is a positive integer.

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