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: Spliting a variable: Reposting


From   "Mike Kim" <[email protected]>
To   <[email protected]>
Subject   st: Spliting a variable: Reposting
Date   Wed, 7 Dec 2011 17:35:12 -0600

Sorry, again. My data structure in the previous posting seems all broken.

I have a question about splitting a variable. My data look like this:

clear 
input str40 author str80 school
"Aguin, H; Ju, H; Gottfred, RK"	"[Aguin, H; Ju, H; Gottfred, RK] Indiana U"
"Bell, T"	"Drexel U"
"Buck, MR; Novice, MM; Robert, F; Hump, JH"	"[Buck, MR] U Oklahoma;
[Novice, MM; Robert, F] U Mississippi; [Hump, JH] Texas U"
"Kohli, C; Juri, R"	"[Kohli, C] Calif U; [Juri, R] Kansas U"
end

I would like to change into the following form. I tried the following, but
it is not easy to change into this form. Can anyone please help?
split school, p(";" "]")

clear
input str30 author str30 school
"Aguin, H"     "Indiana U"
"Ju,H"           "Indiana U"
"Gottfred, RK"  "Indiana U"
"Bell, T"          "Drexel U"
"Buck, MR"     "U Oklahoma"
"Novice, MM" 	"U Mississippi"
"Robert, F"    "U Mississippi"
"Hump, JH"   "Texas U"
"Kohli, C"      "Calif U"
"Juri, R"        "Kansas U"
end

Thanks in advance.
Mike.


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