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
STATA-- How to convert exponential parameters to normal distribution parametersHi everyone, I have a exponential parameters of mean and std. However, I would like to have these 2…
Why F-test is missing? Could you please help!Hi, I run some regressions, but the F-test is missing. I read some previous posts related to this i…
linear splines with knotsDear Stata users, I am trying to create the following graph using Stata. In this graph, hazard rati…
Using boottest after bootstrap clustering with 1000 replication ??I am using a diff-in-diff methodology on a cross-sectional data. I am first using bootstrap cluster…
conditional rowtotalHello, I am trying to sum across columns only the 1s. I have tried egen pri_sum=rowtotal(pri_q1-pri…
Subscribe to:
Post Comments (Atom)
0 Response to Using loop to import and merge excel files
Post a Comment