Hi all,
I am trying to cut a section of a string variable up, specifically variables with "C/V" within the observation.
I used regexm to first identify which observations had "C/V", and can use subinstr to remove "C/V", however I need to remove "C/V" along with the text/numbers that follow right after, up until a punctuation is encountered.
The sample of the data that I have looks like this
Avda. Crevillente C/V Madrid, 2
Avda. Cartagena C/V San Francisco
Pza. De Las Malvas C/V Ferris, 17
The output I would like to get from the command will be
Avda. Crevillente, 2
Avda. Cartagena
Pza. De Las Malvas, 17
Help will be much appreciated! Thank you!
I am trying to cut a section of a string variable up, specifically variables with "C/V" within the observation.
I used regexm to first identify which observations had "C/V", and can use subinstr to remove "C/V", however I need to remove "C/V" along with the text/numbers that follow right after, up until a punctuation is encountered.
The sample of the data that I have looks like this
Avda. Crevillente C/V Madrid, 2
Avda. Cartagena C/V San Francisco
Pza. De Las Malvas C/V Ferris, 17
The output I would like to get from the command will be
Avda. Crevillente, 2
Avda. Cartagena
Pza. De Las Malvas, 17
Help will be much appreciated! Thank you!
Comment