Tuesday, February 28, 2006

st: RE: Mata dir

One answer comes on three levels.

1. What you are doing is illegal. You are taking a bit of Mata and trying to issue it as a Stata command. This will not work.

mata: dir(".", "files", "*")

is legal but will not help you do very much. It will show you a column vector with the names of the files in question but you can get that in other ways.

2. You will get nowhere diving into the depths of Mata without learning more about Mata. In general, to do anything with the results of this Mata command you need to embed it within a Mata program.

3. You say you want a column vector of filenames but do not say why. If you just want to work through a list of filenames then the command -fs- from SSC may help.

(As urged before on Statalist, please do not describe your questions as "very silly". This does not make your question any more interesting or legitimate. Everyone is entitled to be confused. Everyone is entitled to ignore questions they do not want to answer. No other comments are needed.)

Nick n.j.cox@durham.ac.uk

Mosca, Ilaria > 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? > Thanks in advance for your help! > Ilaria > > Met inachtneming van eventuele beperkende bepalingen in deze > e-mail, mag u deze informatie gebruiken voor het doel > waarvoor u die ontvangt. Aan deze gegevens kunnen geen > rechten worden ontleend. CTG/ZAio aanvaardt geen > aansprakelijkheid voor de juistheid en volledigheid van deze > gegevens. Enige schade, ontstaan door de ontvangst of het > gebruik van dit e-mailbericht of de informatie daarin, komt > voor uw eigen verantwoordelijkheid. Als u een officiele > beslissing (besluit, beslissing op bezwaar) van het CTG/ZAio > wilt waaraan rechtsgevolgen verbonden zijn is een > e-mailbericht onvoldoende. U dient dan een schriftelijke en > ondertekende brief of fax te sturen met daarin het verzoek of bezwaar. > > > > * > * 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/ >

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


Tag:


Links to this post:

Create a Link



<< Home

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