I have a folder (with subfolders) containing many excel files. Each file has two columns: Name and Code. I'm trying to figure out a way to import and combine all of these files using Stata (ultimately to create one large excel spreadsheet). I've found several related answers online, but I haven't been successful at modifying them to fit my problem. I would like to avoid changing the file names or converting them to csv files if possible (there are over 200 files).
On another forum, it looked like I could use local macros to input the files (source: http://www.stata.com/statalist/archi...sg00242.html):
local allfiles : dir . files *.xls
But when I try to even do a simple local macro, I get the error, "invalid name". For example:
local example "hello"
list 'example'
I know I should be looping through the files and appending them, but I'm not sure how to begin. Does anyone have ideas?
Any help would be much appreciated. I'm a newbie to Stata and to this site, so please forgive me if I've made mistakes in the formatting of my question. Thanks so much!
Krista
On another forum, it looked like I could use local macros to input the files (source: http://www.stata.com/statalist/archi...sg00242.html):
local allfiles : dir . files *.xls
But when I try to even do a simple local macro, I get the error, "invalid name". For example:
local example "hello"
list 'example'
I know I should be looping through the files and appending them, but I'm not sure how to begin. Does anyone have ideas?
Any help would be much appreciated. I'm a newbie to Stata and to this site, so please forgive me if I've made mistakes in the formatting of my question. Thanks so much!
Krista
Comment