Please ignore my previous post, the following command with -outfixt-
gives perfect results, i.e, correct formatting copied from the Stat data
file and correct starting positions for all columns.
quiet outfixt a b c d e f g h i j k l m n o p using filename, replace
cols ( 1 4 12 20 28 36 46 56 68 83 93 123 138 146 151 153) format flist
( )
Thanks,
-Prash.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Prashant
Shukla
Sent: Wednesday, December 17, 2008 3:13 PM
To: [email protected]
Subject: st: outfix2 and outfixt
Hi All,
If any one has used -outfix2- and -outfixt- please provide some
guidance.
I need to produce fixed width files with the columns formatted a certain
way; and I already have all the columns in the right format. I have been
trying to use both these routines but have been unsuccessful. While
using -outfix2- the following command gives me "option format ()
incorrectly specified" error.
quiet outfix2 a b c d e f g h i j k l m n o p using filename, cols (1
4 12 20 28 36 46 56 68 83 93 123 138 146 151 153) format (%3s %8.0g
%8.0g %8s %8.0g %10s %010.6f %09.0f %015.6f %10s %30s %015.6f %8s %5s
%2s %8.0g )
On -outfixt-, when used without the -format- option it gives perfect
results, i.e., all the columns are at their respective places but the
formats are not the way I want them so I have to use the -format-
option. Below is a sample statement:
quiet outfixt a b c d e f g h i j k l m n o p using "filename",
replace cols (1 4 12 20 28 36 46 56 68 83 93 123 138 146 151 153 )
However, when I introduce the -format- and -flist- option, the resulting
columns are not where I want. For instance, the second column does not
start at position 4 instead there is a gap of 4 spaces between the first
and the second columns and the after that none of the columns are in
their respective positions. Below is a sample statement again:
quiet outfixt a b c d e f g h i j k l m n o p using "filename",
replace cols (1 4 12 20 28 36 46 56 68 83 93 123 138 146 151 153 )
format flist (%3s %8.0g %8.0g %8s %8.0g %10s %010.6f %09.0f %015.6f %10s
%30s %015.6f %8s %5s %2s %8.0g )
Also, FYI, there are columns which are prescribed to be longer than the
elements that they actually contain, i.e. column with a width of 30 does
not necessarily have an element that long. And there are some blank
columns too. But this did not matter when not using -format- option. Why
is the introduction of -format- changing things now? Is it not possible
to just use the formats from Stata without having to list the format for
each of the variables in the -outfixt- command? Please shed some light
on this if you can. Thanks you all very much,
-Prash.
*
* 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/
*
* 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/