All,
I am trying to search for string matches with partial string as the search criteria . I have tried multiple ways as I show below - I believe there must be a better way using RegEx or Pat Match to do this - but I am unable to get it right. Any help will be appreciated .
For the Sake of an example , I am using Air Traffic Sample Data table :
// Method # 1 Using Pat Match
dt = Current Data Table();
ColNames = dt << Get COlumn Names();
Match = list();
sp = Pat Span("ID");
Pat Match(ColNames,sp>>Match);
Match;
// This yields no matches . However in the same code - if ID itself was a column name - this works . So I want to understand how to use part of the search string to do the search .
// Method # 2 Using Contains()
for( i=1, i<= N Items(ColNames),i++,
If(Contains(ColNames,"ID")== 1,
Insert Into(Match,i);
);
);
Best
uday