Hello
I have data as below:
I'm trying to separate and create a new variable from the first part of the string before the first comma, so:
North Allowton North
LN 2
South 1 & 2
I found a post (https://www.statalist.org/forums/for...=1729853922649) that seeks to get the last part of the string after the comma, but I couldn't figure out how to adapt that for my purposes.
Any help would be greatly appreciated!
Thanks,
Meghan
I have data as below:
Code:
clear inp str199 precinct "North Allowton North, North Allowton Elementary, 1139 Corner Rd, Linville, PA 19333" "LN 2, Township Building, 3298 Center Dr, Uppertown, PA" "South 1 & 2, Dallingford Elementary, 422 S Long St, Chesterfield, PA" end
North Allowton North
LN 2
South 1 & 2
I found a post (https://www.statalist.org/forums/for...=1729853922649) that seeks to get the last part of the string after the comma, but I couldn't figure out how to adapt that for my purposes.
Any help would be greatly appreciated!
Thanks,
Meghan
Comment