Jump to content
UBot Underground

Using a list with delimiter, How ?


Recommended Posts

ok try this

 

 

list form file <list test> your txt file

LOOP list total test

list from text next list item test : as delimiter <list test 1>

nav to site

fill form 1 next list item <list test 1>

fill form 2 next list item <list test 1>

fill form 3 next list item <list test 1>

 

 

Pftg4

Link to post
Share on other sites

No problem. If you need help with the code let me know.

 

John

 

 

I just couldnt figure out how to use it. So i just make 4 diffirent list. And used "add to list" and 'list from file"

 

And "change choosen attribute" "next list item"

 

I hope Ubot will not mix up list :)

 

However i still want to know to take data data from a delimited list or csv file

Link to post
Share on other sites

I need to fill 3 text fields. Data must be taken from a txt file. My txt file is like this :

 

field1:field2:field3

fielda1:fielda2:fielda3

fieldb1:fieldb2:fieldb3

fieldc1:fieldc2:fieldc3

 

But all 3 values must be taken from same line each time.

 

Any suggestions ?

 

Just two lists, and a loop.

 

input: #input-file
clearList %input-file
addToList(%input-file, listFromFile(#input-file))
loop(listTotal(%input-file) {
set #this-loop-line = nextListItem(%input-file)
clearList %this-loop-line-parts
addToList(%this-loop-line-parts, listFromText(#this-loop-line, ":"))
set #field1 = listItem(%this-loop-line-parts, 0)
set #field2 = listItem(%this-loop-line-parts, 1)
set #field3 = listItem(%this-loop-line-parts, 2)
// Do Stuff
}

  • Like 1
Link to post
Share on other sites
  • 2 years later...
  • 1 year later...

Think logically before you start working!

clear list(%list)
add list to list(%list, $list from file(#Load file), "Delete", "Global")
loop($list total(%list)) {
    set(#test, $next list item(%list), "Global")
    alert("Item 1: {$substring(#test, 0, $find index(#test, ":"))} Item 2: {$replace($substring(#test, $find index(#test, ":"), $subtract($text length(#test), $find index(#test, ":"))), ":", "")}")
}

Edited by unurohack
Link to post
Share on other sites

Ignore the length of this bots code.  My point with this bot was to show an example of using the Delimiter of the line feed combined with Regex to build three different Lists from the original list of Test Data.

clear list(%items1)
clear list(%items2)
clear list(%items3)
add list to list(%MainList, $list from text("field1:field2:field3
fielda1:fielda2:fielda3
fieldb1:fieldb2:fieldb3
fieldc1:fieldc2:fieldc3", "
"), "Delete", "Global")
loop($list total(%MainList)) {
    set(#var, $next list item(%MainList), "Global")
    add item to list(%items1, $replace regular expression(#var, "(.\{1,\}):(.\{1,\}):(.\{1,\})", "$1"), "Delete", "Global")
    add item to list(%items2, $replace regular expression(#var, "(.\{1,\}):(.\{1,\}):(.\{1,\})", "$2"), "Delete", "Global")
    add item to list(%items3, $replace regular expression(#var, "(.\{1,\}):(.\{1,\}):(.\{1,\})", "$3"), "Delete", "Global")
}
clear list(%MainList)

Link to post
Share on other sites
            add list to list(%info, $list from file("{$special folder("Application")}\\yourfilehere.txt"), "Delete", "Global")
            set(#randomlist, $random list item(%info), "Global")
            set(#temp, $replace regular expression(#randomlist, ";.*", $nothing), "Global")
            set(#firstpart, $replace regular expression(#temp, ":.*", $nothing), "Global")
            set(#secondpart, $replace regular expression(#temp, ".*:", $nothing), "Global")

Lets say yourfilehere.txt has the following:

firstemail@yahoo.com:pass1
secondemail@yahoo.com:pass2
thirdemail@yahoo.com:pass3

The top code will read the file, create a list using the yourfilehere.txt.

Then pick a random LIST line..

 

Then turn "firstemail@yahoo.com" into #firstpart

and pass1 to #secondpart

 

I know this is an old thread, but seeing how it got bumped, figured id show an easy example.

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