Statalist


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

Re: st: Finding all variables NOT containing a string


From   "Scott Merryman" <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Finding all variables NOT containing a string
Date   Tue, 9 Oct 2007 08:53:53 -0500

This does not work?

-ds *tempsa*, not -

Scott

On 10/9/07, Alex Gamma <gamma@bli.unizh.ch> wrote:
> 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: gamma@bli.uzh.ch
>
>
> *
> *   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/
>
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index