Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: extracting a specific portion of a string


From   "Mendoza Aldana, Dr Jorge Antonio (WPRO)" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: extracting a specific portion of a string
Date   Thu, 17 Mar 2011 10:35:40 +0800

Dear all,
My dataset has a string variable, from which I need a specific portion of it. The content of the variable is like:

BLOOD
BLOOD(LIPEMIC)
BLOOD(MODERATELYLY
BLOOD, 2ND SPECIMEN
BLOOD,1STSPECIMEN
BLOOD,2NDSPECIMEN
MOTHER'SBLOOD
SERUM,1STSPECIMEN
SERUM,2NDSPECIMEN

and I need to generate a new variable containing either "BLOOD" or "SERUM"
I would appreciate very much if you can give me some hints on solving this.
I'm using Stata 11.1 on a Windows XP machine
Kind regards,
Jorge




====================================================
This message was scanned for viruses with Trend Micro ScanMail, GFI MailSecurity and  GFI MailEssentials by the World Health Organization Regional Office for the Western Pacific.  However, the recipient is advised to scan this e-mail and any attached files for viruses.

Disclaimer:

This e-mail, together with any attachments, is intended for the named recipients only and is confidential. It may also be privileged or otherwise protected by law.

If you have received it in error, please notify the sender immediately by reply e-mail and delete it and any attachments from your system. You may not copy or disclose its contents to anyone.


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index