文章预览
构平荐帮 cd C : \ Download \ 1
fs *. zip
foreach f in ` r ( files ) '{
unzipfile ` f '
}
*
fs *. xlsx
foreach f in ` r ( files ) '{
import excel using "`f'" , first clear
qui {
labone , n ( 1 )
drop in 1 / 2
cap ren Symbol Stkcd
cap g year = substr ( Sgnmnth , 1 , 4 )
cap g year = substr ( End , 1 , 4 )
cap order year
cap order Stkcd
qui foreach v of var * {
cap destring ` v ', replace
}
sca f_temp = "`f'"
loc fname = usubinstr ( f_temp , ".xlsx" , "" , . )
compress
save "`fname'_trial.dta" , replace
}
di ".........................................."
d
cap g year = 0
ta year , m
} 展物逝归-颤勃 Contains data from cdi_detail_trial.dta
Observations: 5,921
Variables: 27 7 Jul 2024 21:29
--------------------------------------------------------------------
………………………………