Hi,
Please, I have 5 excel files: "File1.xls" to "File5.xls". Each file contains only 1 sheet: "Sheet1"
I want to import and merge them using variable id.
variable id uniquely identifies each observation in the excel files.
Usually, I import each file separately save them .dta, then merge. or use xls2dta to convert to. dta before merging. But I was looking for doing it with loop (foreach or forval), is that possible ? also if I have these files with completely different names (not indexed by numbers) for example instead of "File1.xls" I have "name.xls" and "File2.xls" "age.xls". is that possible?
I'm not also interested to keep the separate .dta files created before the merger
I would much appreciate your assistance on the subject.
Thank you in advance
Related Posts with Using loop to import and merge excel files
Dropping rows based on their position related to another rowHello! I'm trying to drop rows based on their position related to another row specified in a compou…
Finding time trends in each variableI am working with panel data of 311 local authorities over 20 quarters. Is there a simple way to fin…
help with lags and autocorrelationHello!!! So i am trying to choose how many lags to do, and someone helped me with some code but i do…
how to drop entire household (of two) if at least one household member has at least one missing on all explanatory variablesDear Statalist, each household consists of a man and a woman (female==1). I want to drop every hous…
How to remove x axis labels in bar graphsHi I need to make a bar graph in Stata with over 600 categories. Given the large number of categorie…
Subscribe to:
Post Comments (Atom)
0 Response to Using loop to import and merge excel files
Post a Comment