文章预览
数据来源:国泰安。 清洗数据 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 Sgnyea year
cap g year = substr ( Accper , 1 , 4 )
cap g year = substr ( DeclareDate , 1 , 4 )
cap g year = substr ( FirstDeclareDate , 1 , 4 )
cap g year = substr ( AccouPeri , 1 , 4 )
cap g year = substr ( SignDate , 1 , 4 )
cap g year = substr ( EventSignDate , 1 , 4 )
cap g year = substr ( LandingTime , 1 , 4 )
cap g year = substr ( SeismogenicTime , 1 , 4 )
cap g year = substr ( ChangeDate , 1 , 4 )
cap g year = substr ( ListedDate , 1 , 4 )
cap g year = DivdendYear
cap ren Symbol Stkcd
cap order year
cap order Stkcd
qui foreach v of
………………………………