I tried to export and generate variables in this way. I have to do that segment of code but for several excel files.
The problem is that I don't know how to replicate because matrix selecting which cells to import change with each file.
Below, its shown an example of my code, but, as you noted, within cellra, numbers of matrix changes. I have like 30 excel files more or less, for that reason I'd like to accelerate the process.
It would be very nice some kind of strategy.
Thanks.
Code:
clear all import excel "INDECOPI ENERO 2019 - PARTE 1.xlsx", sheet("LIQ_EVP_DMAY_CCA_CCE") cellra(A5:L99235) firstrow gen fecha=date(FECHADEREGISTRO ,"DMY") format fecha %td drop FECHADEREGISTRO rename fecha FECHADEREGISTRO destring CODIGOOSINERG, replace saveold INDECOPI_Enero_2019_1_grifos,replace clear all import excel "INDECOPI ENERO 2019 - PARTE 1.xlsx", sheet("GLP_EVP_PEGL_LVGL_COM_PROD_IMP") cellra(A5:L14651) firstrow gen fecha=date(FECHADEREGISTRO ,"DMY") format fecha %td drop FECHADEREGISTRO rename fecha FECHADEREGISTRO destring CODIGOOSINERG, replace saveold INDECOPI_Enero_2019_2_grifos,replace clear all use INDECOPI_Enero_2019_1_grifos, clear append using INDECOPI_Enero_2019_2_grifos saveold INDECOPI_Enero_2019_parte1_grifos,replace
0 Response to Make a loop
Post a Comment