[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Case conversion in stringvars (and 2 cmds with same name)
Part of what you want ("convert everything to lower [upper] case")
can be handled by the lower (upper) function; sorry I can't help
with the rest.
> Dear all,
> I have corporate announcements data where records of a string var are inconsistently capitalised, which makes analysis difficult. To illustrate, the following records should really appear as one and the same:
> Annual Report and Accounts
> Annual Reports and Accounts
> Annual report and accounts
> Annual reports and Accounts
> Annual reports and accounts
> I can globally replace 'reports' by 'report' in a text editor but would like to automate case conversion in Stata if I could - say, convert everything to lower case (or just the first word capitalised, or every word in the header). -renvars- does this but for variable names, not observations. -mixcase-, on the other hand, seems just the job, but it was written by Bill Gould nearly ten years ago (it was part of dm13.1) so I doubt it would run smoothly three or four versions of Stata later. Is anyone aware of an update to this routine or an alternative way of doing the same?
> As part of my search for this, I think I came across two ado files that do something quite similar and bear the same name but are clearly distinct in their syntax (ie the later one doesn't look like an update of the earlier one). The first instance of -replstr- was written by Bill G (dm 13.1 again) while the second (dated 1999) is authored by Wim Van Putten (-findit replstr- brings this up).
> Many thanks,
> * For searches and help try:
> * http://www.stata.com/support/faqs/res/findit.html
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
* For searches and help try: