[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: Can you search within a dataset for a particular character?
-ds- invoked like this scans variable labels. -ds-
does not scan values. Nor does -lookfor- scan values.
To scan values, use -index()- (Stata <= 9) or
-strpos()- (Stata 9), as recommended by Michael Blasnik
and David Kantor. Note that these are really the same
function. -index()- is still there in Stata 9 (and in fact
-strpos()- is there in Stata 8.2, at least).
> Try the command "lookfor". The now undocumented command "ds,
> has(varl *weight* *wieght") if I recall correctly will find an
> instance of either. Information about ds can be found by typing help
> in the command line.
> >I have a dataset of names stored as string variables. Is there any
> >way to search the dataset for all data containing a particular
> >character, a hyphen for example? Also, is there any way to search
> >the same dataset for all names containing a space (as in last names
> >with a space between them ex. von cannon)? Thank you!
* For searches and help try: