Dataset search

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search

Purpose

Search for given term in a dso field, mode, and set.

Synopsis

out = search(dso_in,fieldname,fieldmode,fieldset,searchterm)

Description

Return 'out' as index of matches. Searches are case insensitive (use "" for case sensitive).

NOTE: If field is numeric then 'searchterm' will be interpreted as numeric expression. First characters can be relational operators. Examples can be seen here.

Search Criteria (TEXT):

* = wildcard (similar to SQL wildcard, not strict RE)
"" = exact match.
re: = regular expression.
si: = sample index.

Examples

load arch

arch.label{2}
ans =
Fe
Ti
Ba
Ca
K
Mn
Rb
Sr
Y
Zr

ca_idx = search(arch,'label',2,1,'ca')
ca_idx =
     0
     0
     0
     1
     0
     0
     0
     0
     0
     0

See Also

dataset_sortby, dataset_sortcols, dataset_sortrows