//save excel1,replace use excel1,clear foreach v of varlist _all{ local cc="" forvalues aa=1/6{ local cc1=`v'[`aa'] local cc="`cc'""`cc1'" } disp `cc' //replace `v'="`cc'" in 1 continue,break }