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
Stucked with generating a loop of dummy variables using an indicator variableThe variables are biological_timeA, biological_timeB, biological_timeC, adopted_timeA, adopted_timeB…
Sum of dummy but aggregatedDear all, I am running into an issue that I can use your expertise on. I will write out in this pos…
Last character of last string is dropped when using local macro to name matrix columns, bewildering behaviorStata/MP 14.2 and my installation does not have internet access, so I cannot copy code or output to …
Check if observations are missing at random in panel dataHello everyone, I have unbalanced panel data and I would like to solve the problem of missing value…
Regression: Difference i.cohort and cohort==xDear all, I am currently analyzing how much similarity mother and father (spouses) show in their ye…
Subscribe to:
Post Comments (Atom)
0 Response to Using loop to import and merge excel files
Post a Comment