Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Creating space delimited ASCII data files


From   Svend Juul <SJ@SOCI.AU.DK>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Creating space delimited ASCII data files
Date   Mon, 10 Mar 2008 09:09:37 +0100

 
Barth wrote:
 
I have tried using the outfile command in Stata 9.2 to create a space
delimited, fixed format ascii data file using data from an existing
Stata
data file. I received an error message that the name of the ASCII file I
specified (outfile using <file name>) did not exist. Despite this
message, I
did find the generated file on my computer. However, when I opened the
file,
the information was unintelligible (perhaps it was in raw format?).
(BTW, I
used the wide and nolabel options). Can anyone tell me how to get a
readable
ascii fixed format file using the outfile or similar command?
 
- and later:

This is the syntax I used:

   outfile using "C:\Documents and Settings\...\data.txt", nolabel wide

When I executed this command a second time, I did not get an error
message.
However, the resulting text file when opened does not appear to be an
ASCII
file in fixed column format (it appears instead to either be in Stata
data
file format or in raw format).

========================================================================

I suspect that the first error message about nonexistence of the file
you
were going to create was not an error message, but an information due to
- I guess - that you had included a -replace- option in the command. Did
you?
Showing EXACTLY what you typed and EXACTLY what Stata responded is
necessary
when seeking advice. What else?

When the file does not exist on the disk, Stata informs you about this: 
the -replace- option was unnecessary. This also explains why you did not

get the message the second time; now the file did exist on the hard
disk.

What Stata calls -raw- files are ASCII files. Such files can be opened
and
inspected by any text editor, e.g. NotePad, or word processor, e.g.
Word. 
You don't tell which program you used to open the file. Tell us!

Svend

__________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone:  +45 8942 6090
Home:   +45 8693 7796
Email:  sj@soci.au.dk
__________________________________________ 


*
*   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/



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