I am trying to write the results of a survey to Excel. I need to report a lot of questions, which have the same answer categories (but are not part of a battery). I want to put the answer categories in text into Excel. This could be done by
But as i need to do it a lot of times (and also to understand -gettoken-) it would be convenient to do in a loop using -gettoken-. My intution is
But this returns " is not a valid command name". So how do I put the valuelabels in Excel using gettoken?
Code:
putexcel set test, sheet(test) putexcel a2 = "To a high extent" putexcel a3 = "To some extent" putexcel a4 = "To little extent" putexcel a5 = "To no extent"
Code:
putexcel set test, sheet(test) local extent To a high extent,To some extent,To little extent,To no extent forval x = 2/5{ gettoken label extent : extent, parse(",") putexcel a`x' = "`label'" }
Comment