Statalist The Stata Listserver


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

st: looping over all files in a folder


From   "Radu Ban" <[email protected]>
To   [email protected]
Subject   st: looping over all files in a folder
Date   Tue, 22 Aug 2006 15:35:00 -0400

Dear Listers,

I want to read into Stata a bunch of text files, that are all sitting
in the same folder. I've written a do-file that does the reading in
part, but now I'm looking for a way to loop this do-file over all the
files in the folder.

I have seen the -dir- command which gives me a list of all the files
in the folder, but after that I'm pretty much stuck. I think I can
copy and paste this list into my editor and then play with it but it
seems like a very inefficient method. Especially if new files are
added into the folder at a later time.

Thanks for any ideas,
Radu Ban
*
*   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