cjacobs 2 Posted October 13, 2021 Report Share Posted October 13, 2021 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) } Quote Link to post Share on other sites
Varo 28 Posted October 14, 2021 Report Share Posted October 14, 2021 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) } Quote Link to post Share on other sites
cjacobs 2 Posted October 14, 2021 Author Report Share Posted October 14, 2021 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 Quote Link to post Share on other sites
Varo 28 Posted October 14, 2021 Report Share Posted October 14, 2021 I've tried it too, and its worked. Remember that your desired keywords is case sensitive. Try use Owner, not owner. Quote Link to post Share on other sites
cjacobs 2 Posted October 14, 2021 Author Report Share Posted October 14, 2021 Nothing. Cleared cache and everything. Quote Link to post Share on other sites
Varo 28 Posted October 14, 2021 Report Share Posted October 14, 2021 when you run the bot, close the csv file. Quote Link to post Share on other sites
cjacobs 2 Posted October 14, 2021 Author Report Share Posted October 14, 2021 (edited) Not sure what changed. Took a break and came back this evening and now it's working. Thanks for your help Varo! Edited October 15, 2021 by cjacobs Started working for whatever reason. 1 Quote Link to post Share on other sites
Varo 28 Posted October 15, 2021 Report Share Posted October 15, 2021 No problem cjacobs, glad to help. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.