Good morning,
Start here with 'performancecomment'
Use the following code to extract the text after the final comma to 'finish'
gen finish = substr(performancecomment, strrpos(performancecomment, ",") + 1, length(performancecomment))
Now I need to extract the text between the first and second commas from the right to 'wanted'
Having trouble figuring the code out to achieve this.
Any help appreciated please.
Start here with 'performancecomment'
Use the following code to extract the text after the final comma to 'finish'
gen finish = substr(performancecomment, strrpos(performancecomment, ",") + 1, length(performancecomment))
Now I need to extract the text between the first and second commas from the right to 'wanted'
Having trouble figuring the code out to achieve this.
Any help appreciated please.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str232 performancecomment str71 finish str19 wanted "in touch, led over 1f out, forged clear" " forged clear" "led over 1f out" "mid-field, ridden 2f out, one paced" " one paced" "ridden 2f out" "mid-field, pushed along 3f out, beaten over 2f out" " beaten over 2f out" "pushed along 3f out" end
Comment