Statalist The Stata Listserver


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

Re: st: looping over all files in a folder


From   "Dimitriy V. Masterov" <[email protected]>
To   [email protected]
Subject   Re: st: looping over all files in a folder
Date   Tue, 22 Aug 2006 16:31:04 -0400

Slightly more elegant:

cd "C:\Documents and Settings\Dimitriy V. Masterov\Desktop";

local files : dir "`c(pwd)'" files "*.txt";

foreach file in `files' {;
	insheet using `file', comma clear;
};

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