|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: How to use the marco names?
The SSC command -fs-, returns the file names in the
macro r(files) with double quotes around each filename.
So if you:
. fs *.csv
bs.csv is.csv price.csv big.csv share.csv mag.csv plu.csv
and use compound quotes around `r(files)':
. di `"`r(files)'"'
"bs.csvis.csv" "price.csv" "big.csv" "share.csv" "mag.csv" "plu.csv"
and use compound quotes again when setting the local macro hh:
. local hh `"`r(files)'"'
the double quotes around the filenames will be preserved.
The errors you experienced were due to the internal double quotes and
some of them being removed by Stata since you didn't use compound
double quotes.
The problem with:
. foreach i of local r(files) {
is that r(files) is not considered a local macro.
Hope this helps,
Dan Blanchette
Research Associate
Center for Entrepreneurship and Innovation
Duke University's Fuqua School of Business
[email protected]
------------------------------------------------------------