Date: Thu, 3 Jun 2004 07:34:53 -0600
Reply-To: "Jose G. Benuzillo" <jose.benuzillo@hci.utah.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Jose G. Benuzillo" <jose.benuzillo@hci.utah.edu>
Subject: Re: Syntax for string select
Content-Type: text/plain; charset="US-ASCII"
This strips out the first word of a text string if that word ends with a
comma.
DATA LIST Fixed /var1 1-60 (A).
BEGIN DATA
Daschle, Tom (D-SD)
Oberstar, James L. (DFL-MN, 8th)
Boswell, Leonard L. (D-IA, 3rd)
Committee on Financial Services
Committee on Agriculture
Olver, John W. (D-MA, 1st)
Larsen, Rick (D-WA, 2nd)
END DATA.
STRING var2(A35).
COMPUTE var2=LTRIM(SUBSTR(var1,INDEX(var1,',')+1)).
EXECUTE.
Jose
Jose Benuzillo, M.A.
Huntsman Cancer Institute
Cancer Control and Population Sciences
2000 Circle of Hope
Salt Lake City, UT 84112
801.585.6610
-----Original Message-----
From: Jeff Hayes, Ph.D. [mailto:jwh_123@yahoo.com]
Sent: Thursday, June 03, 2004 7:00 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Syntax for string select
Hi,
Can anyone help me with the syntax for creating a new string variable
that
strips out the first word of a text string if that word ends with a
comma. So
assuming the below vector (TEXT) ...
Daschle, Tom (D-SD)
Oberstar, James L. (DFL-MN, 8th)
Boswell, Leonard L. (D-IA, 3rd)
Committee on Financial Services
Committee on Agriculture
Olver, John W. (D-MA, 1st)
Larsen, Rick (D-WA, 2nd)
The syntax would produce the below vector (NEWTEXT) ...
Daschle
Oberstar
Boswell
Oliver
Larsen
Any help is appreciated!
Cheers,
Jeff
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
Huntsman Cancer Institute wishes to promote open communication while protecting confidential and/or privileged information. If you have received this message in error, please inform the sender and delete all copies.
|