各位前辈 请教一个关于如何把一个路径下的所有文件的问题 不胜感激!我有96个数据从Jan 2007到Dec 2014,每月一个数据。我把这些数据都是loop处理的。最后一步想把96个数据合并起来,我用了下面的命令:
clear
cd "C:\2_Data\HostCrossBorder20072014 -Match sample_match yrselect2016_12_05"
foreach f in `r(files)' {
append using `f'
}
可是出现了下列错误:
(note: variable entity_name was str71, now str73 to accommodate using data's values)
(note: variable sub_type was str18, now str21 to accommodate using data's values)
(note: variable category was str45, now str46 to accommodate using data's values)
(note: variable position_name was str35, now str38 to accommodate using data's values)
(note: variable entity_name was str73, now str77 to accommodate using data's values)
variable evaluation_method is str3 in master but byte in using data
You could specify append's force option to ignore this string/numeric mismatch. The using variable would then be treated as if it contained
"".
r(106);
我检查了一append后的结果,只append了两年循环就停止了
. tab year
year | Freq. Percent Cum.
------------+-----------------------------------
2007 | 360,684 41.30 41.30
2008 | 512,624 58.70 100.00
------------+-----------------------------------
Total | 873,308 100.00
我的问题是:我对所有原始数据都是loop批处理的,没有变动数据格式,为什么有些年份可以合并起来,有些年份却不可以呢?这样的问题应当怎样解决才可以把所有的数据append在一起呢? 谢谢各位老师同学指教!在下先谢谢了!