Dear Stata users,
I am trying to separate addresses inside a string variable into new observations, like:
from:
"address11 // address12 // address13"
"address21 // address22 // address23"
to:
address11
address12
address13
address21
address22
address23
The problem is not really it, but it is that the separator ("//") is not constant between observations and I actually have a dataframe like:
"address11 //////// address12 / address13"
"address21 ///// address22 /// address23"
"address31 // address32 // address33"
Now I am trying to make the number of ("/") constant between rows, in order to then I can separate the addresses. So I am trying to convert the previous dataframe into a one similar to the first I showed.
I tried using "moss" ssc command, but if you can give any idea to performed that I will be very grateful.
Thank you in advanced,
Paulo
I am trying to separate addresses inside a string variable into new observations, like:
from:
"address11 // address12 // address13"
"address21 // address22 // address23"
to:
address11
address12
address13
address21
address22
address23
The problem is not really it, but it is that the separator ("//") is not constant between observations and I actually have a dataframe like:
"address11 //////// address12 / address13"
"address21 ///// address22 /// address23"
"address31 // address32 // address33"
Now I am trying to make the number of ("/") constant between rows, in order to then I can separate the addresses. So I am trying to convert the previous dataframe into a one similar to the first I showed.
I tried using "moss" ssc command, but if you can give any idea to performed that I will be very grateful.
Thank you in advanced,
Paulo
Comment