Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Mata dir


From   [email protected] (William Gould, Stata)
To   [email protected]
Subject   Re: st: Mata dir
Date   Tue, 28 Feb 2006 14:09:34 -0600

Ilaria Mosca <[email protected]> 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
[email protected]
*
*   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/



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