Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Re: st: looping with vars across file


From   mai7777 <[email protected]>
To   [email protected]
Subject   Re: Re: Re: st: looping with vars across file
Date   Sat, 11 Oct 2008 13:06:32 -0400

Dear Martin,
This worked beautifully! Many many thanks for you great help.you saved
me so much frustration.

Best,

On Sat, Oct 11, 2008 at 2:44 AM, mai7777 <[email protected]> wrote:
> Hi,
> I have two files, file 1 and file 2. I want to use each var (one by
> one) from file 1 to run a loop in file 2.
> Eg:
>
> File one:
> var1  var2....varn
> 101    99       .
> 76     104     .
> 89     107     .
>
> I want to run a loop in file two that takes each value for vars1-varn
> in file 1 and loops over it: So for var1 of file1, I want to run the
> following loop in file2:
> foreach i in `i' 101 76 89 {
> ......
> }
>
> and so on for each var of file 1.
> Is there a way to do that?
>
> *
> *   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/
>
*
*   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/



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