Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: RE: data management question


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: data management question
Date   Fri, 15 Oct 2010 17:48:56 +0100

If this were my problem, I would certainly start off thinking about -file-. I might include an -outsheet- to send the data to a temporary file and then also read them in using -file-. As you say, -filefilter- also seems natural. 

Much depends on whether this is an absolutely fixed design imposed on you. 

Nick 
[email protected] 

Airey, David C

I need to automate the creation of many tab delimited text (ascii) files.

The structure is:

# comments
# comments
# comments
# comments
@format=column var1 se n var2 se n var3 se n
1 10 2 8 50 5 8 x x x
2 11 1.9 8 50 5 8 30 3 8
3 12 1.7 8 50 5 8 30 3 8
4 13 2 8 50 5 8 30 3 8
5 18 2.1 8 50 5 8 30 3 8

etc

Problems with this file format are use of "x" for missing, column naming 
conventions not compatible with Stata (@ symbol, repeated column names), 
use of # for header comments.

-Outfile- or -outsheet- can export the data from underneath 
the @ line just fine, and maybe -filefilter- can change the missing data to "x" as 
needed. Should -file- be somehow used to create the file up to the @ line and then 
-outsheet- below and then somehow join the two?

How do others handle the creation of data files that have nonstandard header text?


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index