Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Partho Sarkar <partho.ss+lists@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Searching for files with a particular *value* of a variable |
Date | Thu, 1 Mar 2012 13:53:58 +0530 |
Many thanks, Nick! This will get me started. Partho On Thu, Mar 1, 2012 at 1:23 PM, Nick Cox <njcoxstata@gmail.com> wrote: > You can approach this in various ways. I haven't used either of the > user-written programs you mentioned but let's just approach it from > first principles: > > local present > quietly foreach f in <filelist> { > use `f' > count if <varname> == <value> > if r(N) local present `present' `f'' > } > > di `present' > > You'd need something subtle if your filenames contain spaces. > > Nick > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/