Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Formatting behavior of -outfile-


From   Mike Lacy <[email protected]>
To   [email protected]
Subject   st: Formatting behavior of -outfile-
Date   Sun, 26 Apr 2009 17:30:47 -0600


I am confused by the behavior of -outfile- as compared with its documentation. I'm using v9.2 SE, though I wouldn't think it should matter. The documentation says that "Numeric variables are output right-justified in the field width specified by their display format," but I find that -outfile- invariably inserts two extra spaces between variables.

//Example
// outfile example
clear
set obs 3
gen long x = 1e4 * uniform()
gen long y = 1e4 * uniform()
gen byte z  = (uniform() > 0.5)
format x y %7.0f
format z %3.0f
tempfile temp
outfile using `temp'
di "123456789012345678901234567890"
type `temp'
//
// Which yields   (view in nonprop. font)
123456789012345678901234567890
   4948     8908    0
   7607     1205    1
   6917     1143    1

x is displayed in 7 columns, but y occupies 9, and z occupies 5 columns. Can someone suggest what I am missing here?

Regards,

=-=-=-=-=-=-=-=-=-=-=-=-=
Mike Lacy
Fort Collins CO USA
(970) 491-6721 office






*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index