> -----Original Message-----
> From: Jiang, Tao [mailto:[email protected]]
> Sent: Wednesday, August 14, 2002 2:08 PM
> To: '[email protected]'
> Subject: st: RE: single spaces in outfile
>
>
> I have this kind of problem also. I am wondering why stata's
> outfile cannot
> do something like:
>
> outfile _col(1) v1 _col(10) v2 _col(20) v3
>
> or something similar to SAS's "put" command to generate better output?
>
With the file command, you can roll your own version of this fairly
easily:
version 6
file open myfile using <filename>, text write replace
local N=_N
forval i=1/`N' {
local line : di _col(1) varname1[`i'] _col(25) varname2[`i'] ...
file write myfile `"`line'"' _n
}
file close myfile
version 7
This could be wrapped up in a program pretty easily, I think. One
important note: the "version 6" directive at the top is key--otherwise
the macro created by the "local line : ..." command will have smcl
directives such as "{col 25}" rather than actual spaces.
Cheers,
Nick Winter
*
* 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/