Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Airey, David C" <david.airey@vanderbilt.edu> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | st: data management question |
Date | Fri, 15 Oct 2010 11:40:33 -0500 |
. 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? -Dave * * 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/