Hi all, I am having some issues automating a process to crop, reshape, and merge datafilee that are on multiple different sheets of the same workbook.
Basically each sheet contains panel data in wide format and has a few lines at the top with the name of the data, but otherwise the data keeps the same cell array.
So basically the loop should do something like: 1) import each sheet, use the string in that first line to populate a new variable that helps indicate the name of the table from where the data comes from; 2) crop the selection to a specified array; 3) reshape it to long form; and then 4) save it as a .dta file.
Are there any elements of this loop that appear, right off the bat, impossible or far too complicated? If not, how would this loop like? I’ve tried to replicate many things I’ve found in other threads, but nothing really works all that well.
Thank you all so much
Basically each sheet contains panel data in wide format and has a few lines at the top with the name of the data, but otherwise the data keeps the same cell array.
So basically the loop should do something like: 1) import each sheet, use the string in that first line to populate a new variable that helps indicate the name of the table from where the data comes from; 2) crop the selection to a specified array; 3) reshape it to long form; and then 4) save it as a .dta file.
Are there any elements of this loop that appear, right off the bat, impossible or far too complicated? If not, how would this loop like? I’ve tried to replicate many things I’ve found in other threads, but nothing really works all that well.
Thank you all so much
Comment