Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: creating a text file with a specific format

From   Michael Eisenberg <>
Subject   st: creating a text file with a specific format
Date   Tue, 17 Jan 2012 06:56:02 -0800


I have to prepare a file for a linkage project, and I’m hoping stata can assist.

Currently my data is in a stata data file.

The linkage company requires a set format of data in a plain text format.

The format assumes 100 characters per line. Where () represents which
line characters are assigned to a given field.   If a variable has
more characters than the designated number of characters, it is to be

(1-20) LAST NAME
(21-35) FIRST NAME
(37-45) SSN
(48-49) DAY OF BIRTH

The data currently looks like this

Lastname  firstname  middlename   SSN    	MonOB	DaOB	YrOB
Smith	John	         Thomas	122342789	     01	04		1947
Jones	Craig 	Harvey	600656785	     10	24		1957
Stata	        Jim	        Smith	423456751	     12	06		1970
Johnson	Mike	        Thomas	056445671     01	16		1971

Can Stata perform such a transformation?  If not, are there other
programs that could be recommended.

Thank you in advance.


*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index