Comparing Names of column from two different data tableHello,
I am writing a script where user will select particular column name from one data table using panel box. Then selected column will be compared against column name from a different table and select the column when it matches.
I am facing a problem related to {"x"}. When i am selecting column from panel box and storing in variable, it is getting stored as selected_cols= {"BIN"}. Now when i am comparing it against column names from 2nd data table, result is giving no column matches even though 2nd table has BIN column . When i checked when comparing its comparing {"BIN"} against BIN and giving no matching, I even tried putting char (selected_cols) but it makes {"BIN"} to "{\!"BIN\!"}".
Please help in getting this issue resolved.
Re: Comparing Names of column from two different data tableThanks for quick help. it worked. You were right i was comparing list with a string that's why not getting result.
Re: Comparing Names of column from two different data tableI am not totally sure of the issue, without seeing the code, but I am guessing that you are running into an issue where you are ending up comparing a list to a string. {"x"} is a list. If you want to compare it to a string, you need to use it's subscript......
a={"x"};
b="x";
show(a==b);
show( a[1]==b);