Hi,
i am pretty new to stata and would now like to find out how to remove string data by generating a new variable.
The strings (pnumber) look like this:
224242424(A)
2456474(B1)
7843535377(C)
24256809(U1)
087378935(B1)
etc..
I want to create a new variable that deletes the Brackets completey, leading to "224242424", "2456474", etc...
So far I am only able to delete one of these brackets at a time, using the command "gen pauth=subinstr(pnumber,"(B1)","",.)"
How can I delete all expression in brackets (A,B1,C,U1) at once?
Thanks in advance!
i am pretty new to stata and would now like to find out how to remove string data by generating a new variable.
The strings (pnumber) look like this:
224242424(A)
2456474(B1)
7843535377(C)
24256809(U1)
087378935(B1)
etc..
I want to create a new variable that deletes the Brackets completey, leading to "224242424", "2456474", etc...
So far I am only able to delete one of these brackets at a time, using the command "gen pauth=subinstr(pnumber,"(B1)","",.)"
How can I delete all expression in brackets (A,B1,C,U1) at once?
Thanks in advance!
Comment