求各位高手们指教,我现在有很多csv文件,每个文件中的observation都是不完全一样的,所以数据局结构有差别,我现在需要把这些文件中每个文件都提取相同的两个变量,然后tabulate,制成一个表,现在的问题是我需要用loop,这样可以所有文件一次性弄完(不然工作量十分可怕啊!), 但是我写的do file没有办法生成我想要的表格,我现在试了很多办法,都没有结果,特别感谢有思路的大牛们不吝赐教!下面是我的do file:
cd "E:\lfs\All countries\Sweden\se9596"
local myfiles: dir "E:\lfs\All countries\Sweden\se9596" files "*.csv"
*Adding this will display the files names
foreach file of local myfiles {
insheet using `"`file'"',clear
logout, excel save(table_`file') replace: tabulate na111d is881d
}