<>
I take "cell" to denote an observation of a -string- variable... Install
Nick`s -ssc inst egenmore- and:
*************
clear*
input str30 mystr
"first st|r|"
"se|cond str|ing"
"third string"
"fou||rth| strin|g"
end
compress
egen numberofocc= /*
*/ noccur(mystr) , string(|)
list, noobs
*************
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Andrea Rispoli
Gesendet: Donnerstag, 17. September 2009 12:16
An: [email protected]
Betreff: st: Count special characters
Dear Statalisters,
is there a command that I can use to count the number of "|" in a cell?
Thank you very much.
AR
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/