Greetings,
How I can extract numbers from a string variable and place them in a separate column. In my dataset, I'd like all these numbers appearing in the variable "province" to be present in a new variable named "Region."
----------------------- copy starting from the next line -----------------------
How I can extract numbers from a string variable and place them in a separate column. In my dataset, I'd like all these numbers appearing in the variable "province" to be present in a new variable named "Region."
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(province_row district_row) str44(province district) str13 Province 1 0 "REGION 01 NORTHERN" "" "NORTHERN" 0 1 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" 0 0 "REGION 01 NORTHERN" "DISTRICT 0101 CHILUBI" "NORTHERN" end
Comment