Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Searching for files with a particular *value* of a variable
From
Partho Sarkar <[email protected]>
To
[email protected]
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 <[email protected]> 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/