.
DrugID | PatentNumber |
1 | US12345 EU456789 ZA19847216 |
QUESTION:
.
I would like to reformat the data as either:
.
DrugID | PatentNumber |
1 | US12345 |
1 | EU456789 |
1 | ZA19847216 |
OR
.
DrugID | PatentNumber |
1 | US12345EU456789ZA19847216 |
where in the latter case, perhaps I could use a variant of
Code:
split
.
DrugID | PatentNumber | PN1 | PN2 | PN3 |
1 | US12345 EU456789 ZA19847216 |
US12345 | EU456789 | ZA19847216 |
and then go from there. Thank you!
----------------------------------------------------------
For the record, I tried to provide a data sample using
Code:
dataex
Ex:
.
DrugID | PatentNumber |
1 | US12345 |
My apologies!
I have included a screenshot of the data for convenience. You will notice that in the data preview, Stata appears to string the lines together, but in reality if you click on an observation like 22, you will see Stata is only acknowledging the first patent number. Something like
Code:
display PatentNumber[22]
.
Array
0 Response to Dealing with line breaks in observations
Post a Comment