My variables in Stata are of the form:
First Name: Allen
Last Name: Von Schmidt
Birth Year: 1965
County: Cape May
State: New Jersey
First Name: Lee Roy
Last Name: McBride
Birth Year: 1967
County: Cook
State: Illinois
I would like to outsheet them to create comma separated rows in a .txt as:
Allen,Von Schmidt,1965,Cape May, New Jersey
Lee Roy,McBride,1967,Cook, Illinois
How can I use outsheet (or another command) to do this? Do I need to make the numerics into strings first? Do I need to add a commas to each variable first? Thanks!
Would something like the following work?
outsheet first last birth_year county state using FileName.txt, comma nolabel noquote
If I wanted to do the same thing but have the variables be " " separated would I remove the noquote in that previous stata code?
For example, suppose I might, instead, want an output of:
"Allen","Von Schmidt","1965","Cape May","New Jersey"