Statalist


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

[no subject]



Dear statalists,

I am confused by marco names. Could anyone help me ? 
In my opinion, the following four methods should get the
same results.However, not as I expected.

. fs *.csv
bs.csv     is.csv     price.csv  big.csv    share.csv  mag.csv    plu.csv

. di `r(files)'
bs.csvis.csvprice.csvbig.csvshare.csvmag.csvplu.csv

. local hh `r(files)'

. foreach i of local r(files) {
   2. di "`i'"
   3. clear
   4. insheet using `i'
   5. }
{ required
r(100);

. foreach i in `r(files)' {
   2. di "`i'"
   3. clear
   4. insheet using `i'
   5. }
bs.csv
(6 vars, 13299 obs)
is.csv
(9 vars, 13403 obs)
price.csv
(4 vars, 2714 obs)
big.csv
(6 vars, 53870 obs)
share.csv
(9 vars, 2755 obs)
mag.csv
(8 vars, 45028 obs)
plu.csv
(7 vars, 2751 obs)

. foreach i in `hh' {
   2. di "`i'"
   3. clear
   4. insheet using `i'
   5. }
bs.csv
invalid '"' 
r(198);

. foreach i of local hh {
   2. di "`i'"
   3. clear
   4. insheet using `i'
   5. }
bs.csv
invalid '"' 
r(198);

Thank you for any help.

Sincerely,

*
*   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