Tuesday, February 28, 2006

Re: st: Mata dir

Ilaria Mosca <IMosca@ctg-zaio.nl> writes,

> I am trying to create a column vector containing the names of the files in > dir that match pattern. For this purpose I looked at the online help, under > -help mf dir. Subsequently I type the following: > > dir(".", "files", "*") > > but then I obtain the following error message: > dir(".", "files", "*") > invalid '".' > r(198); > > What am I doing wrong?

Ilaria is tying Mata's -dir()- at Stata's dot prompt, which I can tell because of the r(198). Mata would have said something different.

To type:

. mata

: dir(".", "files", "*") <lots of output will appear}

: x = dir(".", "files", "*") // to store result in x

-- Bill wgould@stata.com * * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/


Links to this post:

Create a Link

<< Home

This page is powered by Blogger. Isn't yours?