Hi all,
I have a string variable that is made like this:
I am replacing the string using
and then counting its words using
The problem is that when I adopt wordcount, the words counted in the instance above are 4: Y10S,482/902,Y10S,482/901 whereas they should be 2: Y10S 482/902 and Y10S 482/901. Is there a way to either transform the sting like this:
or to tell stata to consider Y10S 482/902 and Y10S 482/901 as two separate words (and not 4 words)?
In general, there should be a space whenever from numbers we move to words. So for instance, in this case:
the outcome should be something like:
Thank you
I have a string variable that is made like this:
Code:
['Y10S 482/902' 'Y10S 482/901']
Code:
replace tech_class = ustrregexra(tech_class, "[\[\]']", "")
Code:
wordcount(tech_class)
Code:
['Y10S_482/902' 'Y10S_482/901']
In general, there should be a space whenever from numbers we move to words. So for instance, in this case:
Code:
['Y02B 30/13' 'Y02B 30/12' 'Y02E 60/14' 'Y02B 10/70']
Code:
['Y02B _30/13' 'Y02B _30/12' 'Y02E _60/14' 'Y02B _10/70']

Comment