If the files are named as file_1, file_2, .... file_500 or the alike, you
try to use Stata's "for" command, e.g.
foreach fileno in 1/500 {
use file_`fileno', clear
cap drop _merge
sort date
save, replace
}
use file_1, clear
foreach fileno in 2/500 {
cap drop _merge
merge date using file_`fileno', nok
drop _merge
sort date
}
Hope this helps.
Wenjun Li
-----Original Message-----
From: Riano, Alejandro [mailto:[email protected]]
Sent: Monday, August 05, 2002 3:56 PM
To: [email protected]
Subject: st: multiple merge
I have 500 files in STATA format that have two variables:
date and X ; i
need to merge all these files by date in only one file, do
you know a fast
way in which i could do this (not doing it manually, open
each file and then
merge it with the first one) ?
thanks in advance
Alejandro Riano
==========================
Research Department
Inter-American Development Bank
(202) 623-1932
[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/
*
* 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/