Statalist


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

st: Re: too many files for dirlist


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: too many files for dirlist
Date   Mon, 17 Sep 2007 18:07:04 -0400

-dirlist- is an older user-written ado file. But you don't need it to get a list of file names. See -help extended_fcn- and look at the dir function. Here's an example for retrieving a list of all Stata dta files in the current directory:

local fnames: dir . files "*.dta"

Michael Blasnik


----- Original Message ----- From: "Carlos Eduardo Hernandez Castillo" <[email protected]>
To: <[email protected]>
Sent: Monday, September 17, 2007 5:35 PM
Subject: st: too many files for dirlist



Dear statalist community:

I have been using dirlist but it seems it has a maximum number of characters to retrieve in the return macros. For example, in a directory that contains the following files:

13areas.dta 7areas.dta Barranquilla.dta Bogota.dta Bucaramanga.dta Cali.dta Cartagena.dta Cucuta.dta Ibague.dta Manizales.dta Medellin.dta Monteria.dta NalECH.dta NalENH.dta OcupadosNacional.dta Pasto.dta Pereira.dta Proporciones.dta TotalesNacional.dta

"display r(fnames)" would retrieve:

13areas.dta 7areas.dta Barranquilla.dta Bogota.dta Bucaramanga.dta Cali.dta Cartagena.dta Cucuta.dta Ibague.dta Manizales.dta Medellin.dta Monteria.dta NalECH.dta NalENH.dta OcupadosNacional.dta Pasto.dta Pereira.dta Proporciones.dta TotalesNacional

I have been looking for an alternative to get the names of all the files but I have not been able to do so, do you have any idea? I am using Stata 9.2. Thanks in Advance.

Carlos Eduardo Hern�ndez Castillo
*
*   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