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
I should note that the original request was for a single space between
variables -- then the fifth line would look like this:
local line : di varname1[`i'] " " varname2[`i'] " " varname3[`i'] ...
And in that case it would be quite straightforward to build up the macro to
be written with a forvalues loop over the variables to be written, allowing
such a routine to accept a varlist of indeterminate length and generate the
desired single-space-delimited output. However, when using space
delimiting, one must always worry about string variables with embedded
spaces. If there is no risk of that, this would work quite nicely. Here is
a quick and dirty hack that nevertheless seems to work (well, watch out for
string variables):