How can I do the following using a loop? I'm weary as there is a local file within the quotation signs and so, I cannot use loop anymore.
I cannot do the following, especially `file`i'' line.
Any way I can get around this? Thank you!
Code:
tempfile file1 import excel using "file1.xlsx", firstrow clear save `file1', replace tempfile file2 import excel using "file2.xlsx", firstrow clear save `file2', replace tempfile file3 import excel using "file3.xlsx", firstrow clear save `file3', replace use `file1', clear append `file2' append `file3'
Code:
forval i=1/3 { tempfile file`i' import excel using "file`i'.xlsx", firstrow clear save `file`i'', replace } use `file1', clear append `file2' append `file3'
Comment