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

From   "Mike Kim" <>
To   <>
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:

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"

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(";" "]")

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"

Thanks in advance.

*   For searches and help try:

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