For each of my regional data files, I am trying to export confidence interval tables in a csv file. The current output in STATA looks like below, which I would like to replicate in an excel table.

Variable | Obs | Mean | Std. Err. | [95% Conf. Interval]
-------------+---------------------------------------------------------------
accept_vio~n | 330 .3364758 .02605 .2852303 .3877213

However, when I use the code below, the output does not include the variable, nor does it include the observation number. Any advice would be greatly appreciated, as I have tried a number of different solutions on this forum. Thank you.

#delimit;
clear;
use "Dta Files\2019_Indonesia_Weighted_DM.dta";

drop if geographies_DM != 1;
recode city (12=3)(13=2)(14=1), gen (sundacity);
label define sundacity
1"West Nusa Tenggara"
2"East Nusa Tenggara"
3"Bali";
label values sundacity sundacity;

cap postclose ci_results_sunda;

postfile ci_results_sunda var obs mean se lowerCI upperCI using "2019_ci_results_sunda.dta", replace;

foreach var of varlist optimist-accept_violence_religion {;
ci `var'[aweight=weight_pop];
ci `var' if sundacity==3 [aweight=weight_pop];
ci `var' if sundacity==2 [aweight=weight_pop];
ci `var' if sundacity==1 [aweight=weight_pop];
ci `var' if age_group_DM==4 [aweight=weight_pop];
ci `var' if age_group_DM==3 [aweight=weight_pop];
ci `var' if age_group_DM==2 [aweight=weight_pop];
ci `var' if age_group_DM==1 [aweight=weight_pop];
ci `var' if religion_all_DM==4 [aweight=weight_pop];
ci `var' if religion_all_DM==3 [aweight=weight_pop];
ci `var' if religion_all_DM==2 [aweight=weight_pop];
ci `var' if religion_all_DM==1 [aweight=weight_pop];
ci `var' if female_DM==2 [aweight=weight_pop];
ci `var' if female_DM==1 [aweight=weight_pop];
ci `var' if urban_DM==2 [aweight=weight_pop];
ci `var' if urban_DM==1 [aweight=weight_pop];
post ci_results_sunda (`var') (r(obs)) (r(mean)) (r(se)) (r(lb)) (r(ub));
};

postclose ci_results_sunda;
use ci_results_sunda.dta, clear;

use "2019_ci_results_sunda.dta";
outsheet using "ci_results_sunda.csv", comma replace;