i need some help in selecting extracting some keywords from few columns and getting entire rows that have the keywords. Forexample, i have the keywords " socket" and "ball". I want to extract these two keywords from column 1 and column 2. A new datasheet should contain all the rows that contain the two keywords :socket" and "ball"
here is my part of code:
rows2=dt<<get rows where(contains(:column 1,"socket");
the above script only takes one keyword "socket" from one column "column1"
could anyone help with this?
Use an AND (&) and an OR (|). Note the judicious use of parentheses. If this isn't quite what you need you now have the tools (& and |) to build the correct statement.
rows2 = dt << get rows where((contains(:column 1,"socket") & contains(:column 2, "ball")) |
(contains(:column 1,"ball") & contains(:column 2, "socket")));