Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: re: data entries


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: re: data entries
Date   Wed, 20 May 2009 10:07:58 -0400

<>
Martin made the good point

Tunga wants only ":2" at the end of his strings, so Kit`s solution could be
problematic, as it seems to search anywhere within the string...

the 'count' could be amended to

count if strpos(var1,":2") == 8

Naturally, substr() is another way to skin this particular cat.
I'm not sure why Martin is reading 9-character strings with str10 and then using compress in his solution.

Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html
   An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html



*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index