Jump to content
UBot Underground

Problem Checking Table Cell for Specific Text


Recommended Posts

I am trying to loop through a csv to check if table cells contain any of the specific text (#desiredKeywords) but am not having any luck.

Can anyone see what I'm doing wrong?

TIA

clear table(&data)
ui open file("Load CSV",#data)
create table from file(#data,&data)
ui drop down("Column to Check","0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26",#columnToCheck)
ui block text("Desired Keywords",#desiredKeywords)
set(#row,1,"Global")
loop(5) {
    if($table cell(&data,#row,$contains(#columnToCheck,#desiredKeywords))) {
        then {
            alert("Found")
        }
        else {
            alert("Not Found")
        }
    }
    increment(#row)
}

 

Link to post
Share on other sites

Your if condition is wrong.

Try this :

clear table(&data)
ui open file("Load CSV",#data)
create table from file(#data,&data)
ui drop down("Column to Check","0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26",#columnToCheck)
ui block text("Desired Keywords",#desiredKeywords)
set(#row,1,"Global")
loop(5) {
    if($contains($table cell(&data,#row,#columnToCheck),#desiredKeywords)) {
        then {
            alert("Found")
        }
        else {
            alert("Not Found")
        }
    }
    increment(#row)
}

 

Link to post
Share on other sites
47 minutes ago, Varo said:

Your if condition is wrong.

Try this :


clear table(&data)
ui open file("Load CSV",#data)
create table from file(#data,&data)
ui drop down("Column to Check","0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26",#columnToCheck)
ui block text("Desired Keywords",#desiredKeywords)
set(#row,1,"Global")
loop(5) {
    if($contains($table cell(&data,#row,#columnToCheck),#desiredKeywords)) {
        then {
            alert("Found")
        }
        else {
            alert("Not Found")
        }
    }
    increment(#row)
}

 

I've tried that as well and still doesn't work.
I've attached the csv file I'm working with.
I set "Column to Check" = 7
"Desired Keywords" = owner
I only get "Not Found"

Any other ideas?
 

Real-Estate-Brokers-Owners-CLEANED-1.csv

Link to post
Share on other sites

Not sure what changed.
Took a break and came back this evening and now it's working.
Thanks for your help Varo!

Edited by cjacobs
Started working for whatever reason.
  • Like 1
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...