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: RE: extracting a specific portion of a string
From
"Travis Coan" <[email protected]>
To
<[email protected]>
Subject
st: RE: extracting a specific portion of a string
Date
Wed, 16 Mar 2011 23:43:44 -0400
Hi Jorge,
I would take a look at the -substr- function -- typing 'help substr' should get you there.
HTH,
Travis
From: [email protected] [mailto:[email protected]] On Behalf Of Mendoza Aldana, Dr Jorge Antonio (WPRO)
Sent: Wednesday, March 16, 2011 10:36 PM
To: [email protected]
Subject: st: extracting a specific portion of a string
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/
________________________________________
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1204 / Virus Database: 1498/3510 - Release Date: 03/16/11
*
* 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/