Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Finding all variables NOT containing a string


From   "Alex Gamma" <[email protected]>
To   <[email protected]>
Subject   st: Finding all variables NOT containing a string
Date   Tue, 9 Oct 2007 15:30:14 +0200

Hi Statasticians

I have a simple problem, but wasn't able to find the solution:
I want to

a) find all variables whose names do NOT contain a given string (say, "tempsa")
b) have them stored in r(varlist)

Neither -describe-, -lookfor-, nor -ds- seem to be able to do the job. I've looked on the web and found Fred Wolfe's -lfsum-, which finds variables containing a given string with the possibility to exclude other strings. But this command is unable to handle wildcards, so that I cannot list ALL variables except for those containing the string "tempsa". (Also it does not store its results in r(varlist)).

I hope and assume that some of you will immediately know the solution since this must be a frequently encountered problem.

Best regards,
Alex


--
Alex Gamma Ph.D.
University Hospital of Psychiatry
Research Department
Lenggstr. 31
8032 Zurich
Switzerland

Tel: +4144 384 2621
Fax: +4144 384 2446
e-mail: [email protected]


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index