Jump to content
UBot Underground

Need help with two list.


Recommended Posts

I have list A which is a list of folder names being pulled into my bot, then I have list B which is a list from a UI Block Text.

 

I want to see if the number from list B is in list A or not. I did an IF statement, using $Contains as the condition, it seems to work, but not quite right.

 

Say list A has 36078 and list B has 36. With what I have right now, it comes back saying yest list A contains 36 from list B.

 

So I know $Contains is not what I want, but I'm not sure what to use. I believe its going to be a $comparison, but how do I set the values, since both are list.

Link to post
Share on other sites

I thought $List Total gives you the total number in a list. List A may have 500 rows, List B may have 10, but I want to see if all 10 in List B are in List A.

 

So if List A has 1000 to 2000 And List B has three numbers, 1001,1002,3004 I want to see this

 

1001, Yes

1002, Yes

3004, No

 

I'll try what you have there, I may be misunderstanding what all the $List Total returns.

Link to post
Share on other sites

clear list(%List A)

clear list(%List B)

clear list(%results)

add list to list(%List A, $list from file(""), "Delete", "Global")

add list to list(%List B, $list from file(""), "Delete", "Global")

set(#temp, 0, "Global")

loop($list total(%List B)) {

if($contains(%List A, $list item(%List B, #temp))) {

then {

add item to list(%results, "{$list item(%List B, #temp)},Yes", "Delete", "Global")

}

else {

add item to list(%results, "{$list item(%List B, #temp)},No", "Delete", "Global")

}

}

increment(#temp)

}

Link to post
Share on other sites

Ah... I thought you were just wondering if the lists matched or not...

 

In that case you need to loop through List A one at a time with the contents of List B, then record whether or not they match in table or in a column of a csv file.

 

<code removed>

 

**update... TJ beat me to it... and as usual, his code blows mine away, so I'll defer to the master... :rolleyes:

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