That's more elegant, apart from the typo!
"%-%" should be "%-"
Nick
[email protected]
Kit Baum
> Friedrich is correct: there is an extended-macro-function
> called format. Thus Nick's general-purpose program to make
> every string variable left-just (better then mine, in that it
> works on the whole dataset) can be written as
>
> ds, has(type string)
>
> foreach v in `r(varlist)' {
> local f : format `v'
> local ff : subinstr local f "%" "%-%"
> format `v' `ff'
> }
>
> No shorter, but more to the point.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/