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]

Re: st: Renaming variables


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Renaming variables
Date   Tue, 12 Apr 2011 09:31:15 +0100

If you are doing this just once, then using -doedit- to delete the
first 9 lines might qualify as a solution within Stata.

Another is that you can use a so-called dictionary to specify the
first line of data. See -help infile2-. Oddly enough, when I first
started using Stata preparing dictionaries so that Stata could read
them was one of the most frequent activities. When did anyone last ask
about dictionaries on the list?

Nick

On Tue, Apr 12, 2011 at 8:59 AM, BAIJER Jan 212040 <[email protected]> wrote:

> I have a tab delimited text file that I would like to work on using Stata. This file has a header that I'd like to eliminate; line 9 of the file contains variable names, lines 10 and further contain the observations.
>
> I'd like to "transform" my datafile from within Stata, by dropping the first 8 lines, and renaming the variables correctly. There must be a smart way of doing this ?! I could not find out how to get rid of the generic variable names, and instruct Stata to use the information on a given (first) line of the file for variable names.

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